class SimClock extends Clock with NamedLogging
- Alphabetic
- By Inheritance
- SimClock
- Clock
- NamedLogging
- AutoCloseable
- TimeProvider
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new SimClock(start: CantonTimestamp = CantonTimestamp.Epoch, loggerFactory: NamedLoggerFactory)
Type Members
- case class Queued(action: (CantonTimestamp) => Unit, timestamp: CantonTimestamp) extends Product with Serializable
- Attributes
- protected
- Definition Classes
- Clock
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addToQueue(queue: Queued): Unit
- def advance(duration: Duration)(implicit traceContext: TraceContext): Unit
- def advanceTo(timestamp: CantonTimestamp, doFlush: Boolean = true)(implicit traceContext: TraceContext): Unit
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def close(): Unit
- Definition Classes
- SimClock → AutoCloseable
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- implicit def errorLoggingContext(implicit traceContext: TraceContext): ErrorLoggingContext
- Attributes
- protected
- Definition Classes
- NamedLogging
- def failTasks(): Unit
- Attributes
- protected
- Definition Classes
- Clock
- def flush(): Option[CantonTimestamp]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isSimClock: Boolean
- Definition Classes
- Clock
- val last: AtomicReference[CantonTimestamp]
- Attributes
- protected
- Definition Classes
- Clock
- def logger: TracedLogger
- Attributes
- protected
- Definition Classes
- NamedLogging
- val loggerFactory: NamedLoggerFactory
- Definition Classes
- SimClock → NamedLogging
- 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
- implicit def namedLoggingContext(implicit traceContext: TraceContext): NamedLoggingContext
- Attributes
- protected
- Definition Classes
- NamedLogging
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def noTracingLogger: Logger
- Attributes
- protected
- Definition Classes
- NamedLogging
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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.
- def nowInMicrosecondsSinceEpoch: Long
Potentially non-monotonic time provider
Potentially non-monotonic time provider
- Definition Classes
- Clock → TimeProvider
- def numberOfScheduledTasks: Int
- Annotations
- @VisibleForTesting()
- def reset(): Unit
- 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
- 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
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val tasks: PriorityBlockingQueue[Queued]
- Attributes
- protected
- Definition Classes
- Clock
- def toString(): String
- Definition Classes
- SimClock → AnyRef → Any
- 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
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def warnIfClockRunsBackwards: Boolean
- Attributes
- protected
- Definition Classes
- Clock