TimerOptions

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.*).

  • pollInterval: how often the loop reads, with one query per timer store over every partition the node owns, the timers due within lookahead; between reads it sends what it loaded when each is due. A timer scheduled less than lookahead ahead is sent up to pollInterval late at most, plus the timers subscription's lag; a longer lookahead reads more timers at once.

  • retry: how a technical failure to send a timer's command is retried, each attempt at its own due time (RetryPolicy.backoff after the failure), before the timer is parked under PARKED_SUBSCRIPTION after RetryPolicy.maxAttempts attempts in all (wow.timers.max-attempts).

  • maxBusyRetries: how many times in a row a timer whose target refuses it as busy is sent again after RetryPolicy.initialBackoff without spending an attempt; one refusal more spends one, so a target that stays busy parks the timer after its attempts, as a subscription's backpressure does.

  • expiresAfter: a timer found due longer ago than this, after an outage, is not sent but cancelled with the outcome EXPIRED; null, the default, sends every timer however late.

  • batch: the most timers one read of a store loads; parallelism: the most commands a partition sends at once.

  • claimTimeout: how long a claim on a timer being sent holds: a claim whose node died lapses after it, and the next owner of the partition sends the timer again; longer than a send takes.

  • maxFireRate: the most commands a partition sends a second (wow.timers.max-fire-rate), so a backlog of overdue timers after an outage drains at that rate instead of at once; null, the default, sends them as fast as parallelism allows.

  • maxEarlyWait: the longest a scheduled command waits in its target's kernel for its due time on the target node's clock (wow.timers.max-early-wait), holding the aggregate's queue meanwhile. One that arrives earlier than that, its firing node's clock that far ahead, fails at once as a technical failure (me.ahoo.wow.runtime.wait.ResultCodes.SCHEDULE_NOT_DUE), and the runner sends it again after its backoff. A command sent to another context's command topic waits at its intake for its due time first.

Fields may be added: Wow builds it from the host's configuration, so the constructor is internal to Wow.

Constructors

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

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val batch: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun copyWith(pollInterval: Duration = this.pollInterval, lookahead: Duration = this.lookahead, retry: RetryPolicy = this.retry, expiresAfter: Duration? = this.expiresAfter, batch: Int = this.batch, parallelism: Int = this.parallelism, maxFireRate: Double? = this.maxFireRate, claimTimeout: Duration = this.claimTimeout, maxEarlyWait: Duration = this.maxEarlyWait, maxBusyRetries: Int = this.maxBusyRetries): TimerOptions

This TimerOptions with the given fields replaced: Wow's own copy, left out of the ABI.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String