Package-level declarations

Types

Link copied to clipboard

A Pulse is a cadence which informs consumers when to execute work by calling Pulse.beat.

Link copied to clipboard
Link copied to clipboard
class PulseSchedule(val atSeconds: Set<Int>, val atMinutes: Set<Int>, val atHours: Set<Int>, val onDaysOfMonth: Set<Int>, val inMonths: Set<Month>, val onDaysOfWeek: Set<DayOfWeek>)

A Pulse schedule that can be used with schedulePulse to define complex schedules.

Link copied to clipboard

Functions

Link copied to clipboard

Build a complex PulseSchedule with a DSL.

Link copied to clipboard
suspend fun <T> Clock.executeAt(instant: Instant, action: suspend () -> T): T

Execute the provided action at or after instant.

suspend fun <T> Clock.executeAt(dateTime: LocalDateTime, timeZone: TimeZone, action: suspend () -> T): T

Execute the provided action at or after dateTime in timeZone.

Link copied to clipboard

Return a Pulse which beats every period.

fun Clock.fixedPeriodPulse(period: DateTimePeriod, timeZone: TimeZone): Pulse

Return a Pulse which beats every period in timeZone.

Link copied to clipboard
fun Clock.schedulePulse(schedule: PulseSchedule, timeZone: TimeZone = TimeZone.UTC): Pulse

Schedule a Pulse whose beats occur in accordance with schedule for a specific timeZone.

fun Clock.schedulePulse(cronExpression: String, timeZone: TimeZone = TimeZone.UTC): Pulse

Schedule a Pulse whose beats occur in accordance with the provided cronExpression for a specific timeZone.

fun Clock.schedulePulse(timeZone: TimeZone = TimeZone.UTC, scheduleBuilder: PulseScheduleBuilder.() -> Unit): Pulse

Schedule a Pulse whose beats occur in accordance with the built schedule for a specific timeZone.

fun Clock.schedulePulse(timeZone: TimeZone = TimeZone.UTC, atSecond: Int? = null, atMinute: Int? = null, atHour: Int? = null, onDayOfMonth: Int? = null, inMonth: Month? = null, onDayOfWeek: DayOfWeek? = null): Pulse

Schedule a Pulse whose beats occur atSecond, atMinute, atHour, onDayOfMonth, and inMonth for a specific timeZone.