ScheduleRule

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.

Inheritors

Types

Link copied to clipboard
class After @InternalWowApi constructor(val millis: Long) : ScheduleRule

Due once, millis after the commit that sets it.

Link copied to clipboard
class At @InternalWowApi constructor(val epochMillis: Long) : ScheduleRule

Due once, at epochMillis.

Link copied to clipboard
object Companion
Link copied to clipboard
class Cron @InternalWowApi constructor(val expression: String, val zone: String = UTC, val misfire: Misfire = Misfire.COALESCE) : ScheduleRule

Due at each time expression names, in the time zone zone (UTC by default), six fields as Spring's CronExpression reads them; a time missed while no node fired it is handled as misfire says. The runtime evaluates it: the first slot is the first time after the commit that sets it, and each next one the first time after the slot before it.

Functions

Link copied to clipboard
abstract fun firstDue(commitTime: Long): Long?

The first time the schedule is due, in epoch milliseconds, when it is set by a commit at commitTime; null when the rule is evaluated by the runtime, as a Cron rule is.