Package-level declarations

Types

Link copied to clipboard

Sends a due timer's command and returns its outcome (TimerOutcomes): committed, already committed, unchanged, rejected, or sent to another context. A technical failure throws.

Link copied to clipboard
class TimerLoop(options: TimerOptions = TimerOptions(), clock: Clock = Clock.systemUTC(), context: CoroutineContext = Dispatchers.Default, fatals: NodeFatals = NodeFatals.NONE)

The one firing loop of a node: it fires the timers of every TimerRunner registered with it, each a context's log group, in the partitions the node owns there.

Link copied to clipboard
class TimerOptions @InternalWowApi constructor(val pollInterval: Duration = 1.seconds, val lookahead: Duration = 30.seconds, val retry: RetryPolicy = RetryPolicy(maxAttempts = 10, initialBackoff = 1.seconds, maxBackoff = 5.minutes), val expiresAfter: Duration? = null, val batch: Int, val parallelism: Int = 64, val maxFireRate: Double? = null, val claimTimeout: Duration = 30.seconds, val maxEarlyWait: Duration = 5.seconds, val maxBusyRetries: Int = 20)

The tuning of a node's TimerLoop (wow.timers.*).

Link copied to clipboard
class TimerRunner(val context: String, store: TimerStore, ledger: FailureLedger, firer: TimerFirer, loop: TimerLoop)

Fires the timers of one log group of one bounded context in the partitions this node owns: the node's TimerLoop reads them from store and sends them, the runner holds what it loaded and what is being sent per partition (startPartition, stopPartition, driven by the partition leases, me.ahoo.wow.runtime.cluster.PartitionOwnership), so a timer is sent by the owner of its owner's partition. A new owner reads the store again: nothing is handed over.

Link copied to clipboard
class TimersSubscription(context: String, store: TimerStore, partitions: Int, written: (Timer) -> Unit = {})

The built-in timers subscription of one bounded context: writes the timers the context's aggregates schedule into its store, from the system events wow.ScheduleSet and wow.ScheduleCancelled their streams commit. The store is a view of the log: this subscription rebuilds it from the beginning of the log under a new name, and a replay writes nothing twice.