c

com.digitalasset.canton.time

DelegatingSimClock

class DelegatingSimClock extends SimClock

This implementation allows us to control many independent sim clocks at the same time. Possible race conditions that might happen with concurrent start/stop of clocks are not being addressed but are currently unlikely to happen.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DelegatingSimClock
  2. SimClock
  3. Clock
  4. NamedLogging
  5. AutoCloseable
  6. TimeProvider
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new DelegatingSimClock(currentClocks: () => Seq[SimClock], start: CantonTimestamp = CantonTimestamp.Epoch, loggerFactory: NamedLoggerFactory)

    currentClocks

    a function that returns all current running sim clocks

    start

    start time of this clock

Type Members

  1. case class Queued(action: (CantonTimestamp) => Unit, timestamp: CantonTimestamp) extends Product with Serializable
    Attributes
    protected
    Definition Classes
    Clock

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addToQueue(queue: Queued): Unit
    Attributes
    protected
    Definition Classes
    SimClockClock
  5. def advance(duration: Duration)(implicit traceContext: TraceContext): Unit
    Definition Classes
    DelegatingSimClockSimClock
  6. def advanceTo(timestamp: CantonTimestamp, doFlush: Boolean = true)(implicit traceContext: TraceContext): Unit
    Definition Classes
    DelegatingSimClockSimClock
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  9. def close(): Unit
    Definition Classes
    DelegatingSimClockSimClock → AutoCloseable
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. implicit def errorLoggingContext(implicit traceContext: TraceContext): ErrorLoggingContext
    Attributes
    protected
    Definition Classes
    NamedLogging
  13. def failTasks(): Unit
    Attributes
    protected
    Definition Classes
    Clock
  14. def flush(): Option[CantonTimestamp]
    Definition Classes
    SimClockClock
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def isSimClock: Boolean
    Definition Classes
    Clock
  19. val last: AtomicReference[CantonTimestamp]
    Attributes
    protected
    Definition Classes
    Clock
  20. def logger: TracedLogger
    Attributes
    protected
    Definition Classes
    NamedLogging
  21. val loggerFactory: NamedLoggerFactory
    Definition Classes
    SimClockNamedLogging
  22. final def monotonicTime(): CantonTimestamp

    thread safe weakly monotonic time: each timestamp will be either equal or increasing May go backwards across restarts.

    thread safe weakly monotonic time: each timestamp will be either equal or increasing May go backwards across restarts.

    Definition Classes
    Clock
  23. implicit def namedLoggingContext(implicit traceContext: TraceContext): NamedLoggingContext
    Attributes
    protected
    Definition Classes
    NamedLogging
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. def noTracingLogger: Logger
    Attributes
    protected
    Definition Classes
    NamedLogging
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  28. def now: CantonTimestamp

    Potentially non-monotonic system clock

    Potentially non-monotonic system clock

    Never use Instant.now, use the clock (as we also support sim-clock). If you need to ensure that the clock is monotonically increasing, use the uniqueTime method instead.

    Definition Classes
    SimClockClock
  29. def nowInMicrosecondsSinceEpoch: Long

    Potentially non-monotonic time provider

    Potentially non-monotonic time provider

    Definition Classes
    ClockTimeProvider
  30. def numberOfScheduledTasks: Int
    Definition Classes
    SimClock
    Annotations
    @VisibleForTesting()
  31. def reset(): Unit
    Definition Classes
    DelegatingSimClockSimClock
  32. def scheduleAfter(action: (CantonTimestamp) => Unit, delta: Duration): FutureUnlessShutdown[Unit]

    Thread-safely schedule an action to be executed in the future

    Thread-safely schedule an action to be executed in the future

    If the provided delta is not positive the action skips queueing and is executed immediately.

    Same as other schedule method, except it expects a differential time amount

    Definition Classes
    Clock
  33. def scheduleAt(action: (CantonTimestamp) => Unit, timestamp: CantonTimestamp): FutureUnlessShutdown[Unit]

    Thread-safely schedule an action to be executed in the future actions need not execute in the order of their timestamps.

    Thread-safely schedule an action to be executed in the future actions need not execute in the order of their timestamps.

    If the provided timestamp is before now, the action skips queueing and is executed immediately.

    action

    action to run at the given timestamp (passing in the timestamp for when the task was scheduled)

    timestamp

    timestamp when to run the task

    returns

    a future for the given task

    Definition Classes
    Clock
  34. val start: CantonTimestamp
  35. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  36. val tasks: PriorityBlockingQueue[Queued]
    Attributes
    protected
    Definition Classes
    Clock
  37. def toString(): String
    Definition Classes
    SimClock → AnyRef → Any
  38. final def uniqueTime(): CantonTimestamp

    thread safe strongly monotonic increasing time: each timestamp will be unique May go backwards across restarts.

    thread safe strongly monotonic increasing time: each timestamp will be unique May go backwards across restarts.

    Definition Classes
    Clock
  39. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  42. def warnIfClockRunsBackwards: Boolean
    Attributes
    protected
    Definition Classes
    Clock

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @Deprecated
    Deprecated

Inherited from SimClock

Inherited from Clock

Inherited from NamedLogging

Inherited from AutoCloseable

Inherited from TimeProvider

Inherited from AnyRef

Inherited from Any

Ungrouped