abstract class Clock extends TimeProvider with AutoCloseable with NamedLogging

A clock returning the current time, but with a twist: it always returns unique timestamps. If two calls are made to the same clock instance at the same time (according to the resolution of this clock), one of the calls will block, until it can return a unique value.

All public functions are thread-safe.

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

Instance Constructors

  1. new Clock()

Type Members

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

Abstract Value Members

  1. abstract def addToQueue(queue: Queued): Unit
    Attributes
    protected
  2. abstract def close(): Unit
    Definition Classes
    AutoCloseable
    Annotations
    @throws(classOf[java.lang.Exception])
  3. abstract def loggerFactory: NamedLoggerFactory
    Attributes
    protected
    Definition Classes
    NamedLogging
  4. abstract 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.

Concrete 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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. implicit def errorLoggingContext(implicit traceContext: TraceContext): ErrorLoggingContext
    Attributes
    protected
    Definition Classes
    NamedLogging
  9. def failTasks(): Unit
    Attributes
    protected
  10. def flush(): Option[CantonTimestamp]
    Attributes
    protected
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def isSimClock: Boolean
  15. val last: AtomicReference[CantonTimestamp]
    Attributes
    protected
  16. def logger: TracedLogger
    Attributes
    protected
    Definition Classes
    NamedLogging
  17. final def monotonicTime(): CantonTimestamp

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

  18. implicit def namedLoggingContext(implicit traceContext: TraceContext): NamedLoggingContext
    Attributes
    protected
    Definition Classes
    NamedLogging
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. def noTracingLogger: Logger
    Attributes
    protected
    Definition Classes
    NamedLogging
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  23. def nowInMicrosecondsSinceEpoch: Long

    Potentially non-monotonic time provider

    Potentially non-monotonic time provider

    Definition Classes
    ClockTimeProvider
  24. 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

  25. 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

  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. val tasks: PriorityBlockingQueue[Queued]
    Attributes
    protected
  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. final def uniqueTime(): CantonTimestamp

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

  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. def warnIfClockRunsBackwards: Boolean
    Attributes
    protected

Deprecated Value Members

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

Inherited from NamedLogging

Inherited from AutoCloseable

Inherited from TimeProvider

Inherited from AnyRef

Inherited from Any

Ungrouped