Package-level declarations

Types

Link copied to clipboard

A cron expression of six fields, with the syntax of Spring's CronExpression, evaluated without a dependency: second minute hour day-of-month month day-of-week.

Link copied to clipboard
class JobState

The state of one job instance, the aggregate <context>.schedule: the job it runs, by rule, whose own part is override (null: the job's default); whether it is enabled, and, disabled, whether an operator's disable held it (JobDisabled.held); the log partition of a JobScope.SHARDED job's instance; and the last tick: the timer and slot it ran, due at due, with how many ticks and how many slots skipped in all. Only the job aggregate's own evolve functions change it: a test reads it (ScheduleSpec.instanceOf) but cannot set it.

Link copied to clipboard
class ScheduleJob @InternalWowApi constructor(val name: String, val rule: ScheduleRule.Cron, val scope: JobScope = JobScope.SYSTEM)

A job of an me.ahoo.wow.api.annotation.OnSchedule handler: its name, its default rule (the annotation's, overridden by the host's wow.schedules.<name>.*) and its scope.

Link copied to clipboard

The built-in aggregate that keeps a context's jobs: <context>.schedule, one instance per job in its tenant (the default tenant for a JobScope.SYSTEM job), whose id is the job's name, or, for a JobScope.SHARDED job, one per log partition in the default tenant (shardRef): instanceIds are a job's instances' ids. It belongs to its tenant (no owner), has no lifecycle commands, and decides:

Link copied to clipboard

The slots of a schedule's rule: when a timer is first due, which slot comes after one that fired, and what a slot missed while no node fired it becomes. The runtime's firing loop, the timers subscription and the test DSL share it, so a schedule steps through its slots the same way wherever it runs.

Functions

Link copied to clipboard
fun jobStateOf(job: String, rule: ScheduleRule.Cron? = null, enabled: Boolean = false, partition: Int? = null, slot: Long = 0, due: Long? = null): JobState

A JobState of the given facts, for Wow's own modules that stand for the job aggregate without running it (the test DSL's whenTick): only the aggregate's evolve functions set a state's facts otherwise.