Package-level declarations

Types

Link copied to clipboard
class CancelSchedule @InternalWowApi constructor(val key: String)

The system command wow.schedule.Cancel: cancels the schedule key of the aggregate it is sent to.

Link copied to clipboard
data object DisableJob

The system command wow.schedule.Disable: stops the job instance it is sent to.

Link copied to clipboard
class EnableJob @InternalWowApi constructor(val job: String, val rule: JobRule? = null, val partition: Int? = null)

The system command wow.schedule.Enable: creates, or enables again, the instance of the job job it is sent to, the aggregate <context>.schedule whose id is the job's name in its tenant. rule overrides the job's default rule (null keeps the instance's own override, if any); partition is the log partition of an instance of a JobScope.SHARDED job, which the host enables.

Link copied to clipboard
data object JobDisabled

The system event wow.JobDisabled: the instance does not run until it is enabled again.

Link copied to clipboard
class JobEnabled @InternalWowApi constructor(val job: String, val rule: ScheduleRule.Cron, val override: JobRule? = null, val partition: Int? = null)

The system event wow.JobEnabled: the instance of job runs by rule, override its own part of it.

Link copied to clipboard
class JobRescheduled @InternalWowApi constructor(val rule: ScheduleRule.Cron, val override: JobRule? = null)

The system event wow.JobRescheduled: the instance runs by rule from now on, override its own part of it.

Link copied to clipboard
class JobRule @InternalWowApi constructor(val cron: String? = null, val zone: String? = null, val misfire: Misfire? = null)

An instance's own rule of a job: each part that is null follows the job's default (the host's wow.schedules.<job>.*, else the annotation), so a tenant may keep the default cron in its own time zone.

Link copied to clipboard
enum class JobScope : Enum<JobScope>
Link copied to clipboard
enum class Misfire : Enum<Misfire>

What a recurring schedule does with the times it missed.

Link copied to clipboard
class RescheduleJob @InternalWowApi constructor(val rule: JobRule? = null)

The system command wow.schedule.Reschedule: overrides the rule of the job instance it is sent to with rule; null follows the job's default again.

Link copied to clipboard
class ScheduleCancelled @InternalWowApi constructor(val key: String)

The system event wow.ScheduleCancelled: the aggregate cancelled its schedule key.

Link copied to clipboard
class ScheduleContext @InternalWowApi constructor(val timer: String, val key: String, val slot: Long, val due: Long, val skipped: Long = 0)

Which time of a schedule a command was sent for, as its target reads it from me.ahoo.wow.api.decide.Command.schedule: the timer (ref#key@version) of the schedule key, its slot (from 1, one per time it is due), the time that slot was due (epoch milliseconds), and how many slots before it a recurring schedule skipped because they were missed (Misfire.COALESCE). A command sent for a schedule carries it in its headers (HEADERS); its request id is timer#slot.

Link copied to clipboard

The names of the job aggregate, its system commands and events.

Link copied to clipboard
sealed interface ScheduleRule

When a schedule is due: At an instant, After a delay counted from the commit that sets it, or by a Cron expression. A schedule is an aggregate's, under a key: set again, it is replaced; cancelled, it is gone.

Link copied to clipboard
object Schedules

The names of the schedule system commands and events.

Link copied to clipboard
class ScheduleSet @InternalWowApi constructor(val key: String, val rule: ScheduleRule, val target: AggregateRef, val commandType: String, val command: String)

The system event wow.ScheduleSet: the aggregate set its schedule key, to send target the command of type commandType, command its JSON, as rule says. Committed with the aggregate's other events; the built-in timers subscription derives the timer store from it.

Link copied to clipboard
class ScheduleTick @InternalWowApi constructor(val tenantId: String, val job: String, val slot: Long, val skipped: Long = 0, val due: Long = 0, val partition: Int? = null)

What an me.ahoo.wow.api.annotation.OnSchedule handler receives: the tenantId of the instance (the default tenant for a JobScope.SYSTEM or a JobScope.SHARDED job), the job, the slot that was due at due (epoch milliseconds), how many slots before it were skipped (coalesced), and, for a JobScope.SHARDED job, the log partition whose aggregates this tick is for.

Link copied to clipboard
class SetSchedule @InternalWowApi constructor(val key: String, val rule: ScheduleRule, val commandType: String, val command: String)

The system command wow.schedule.Set: sets the schedule key of the aggregate it is sent to, to send it the command of type commandType (context.aggregate.Command), command its JSON, as rule says. Every aggregate decides it without user code, on an aggregate that exists; a saga derives it (me.ahoo.wow.api.subscribe.SagaContext.schedule).

Link copied to clipboard
class Ticked @InternalWowApi constructor(val timer: String, val slot: Long, val skipped: Long, val due: Long)

The system event wow.Ticked: the instance ran the slot of its timer, due at due, after skipped slots the schedule coalesced.

Link copied to clipboard
data object TickJob

The system command wow.schedule.Tick: the schedule of a job instance is due; the slot is the command's ScheduleContext. Only a slot newer than the last one ticks.