KronScheduler

interface KronScheduler

This interface was created for abstraction of next operation. Currently, there is only dev.inmo.krontab.internal.CronDateTimeScheduler realisation of this interface inside of this library, but you it is possible to create your own realisation of this interface for scheduling, for example, depending of users activity or something like this

See also

dev.inmo.krontab.internal.CronDateTimeScheduler

Functions

next
Link copied to clipboard
common
abstract suspend fun next(relatively: DateTime = DateTime.now()): DateTime?

Inheritors

KronSchedulerTz
Link copied to clipboard
KrontabTemplateWrapper
Link copied to clipboard

Extensions

asFlow
Link copied to clipboard
common
@FlowPreview
fun KronScheduler.asFlow(): Flow<DateTime>

This method is a map for asTzFlow and will works the same but return flow with DateTimes

asTzFlow
Link copied to clipboard
common
@FlowPreview
fun KronScheduler.asTzFlow(): Flow<DateTimeTz>

This Flow will trigger emitting each near time which will be returned from this with attention to time zones

doInfinity
Link copied to clipboard
common
inline suspend fun KronScheduler.doInfinity(noinline block: suspend () -> Unit)

Will execute block without any checking of result

doInfinityLocal
Link copied to clipboard
common
inline suspend fun KronScheduler.doInfinityLocal(noinline block: suspend (DateTime) -> Unit)

Will execute block without any checking of result

doInfinityTz
Link copied to clipboard
common
inline suspend fun KronScheduler.doInfinityTz(noinline block: suspend (DateTimeTz) -> Unit)

Will execute block without any checking of result

doOnce
Link copied to clipboard
common
inline suspend fun <T> KronScheduler.doOnce(noinline block: suspend () -> T): T

Execute block once at the KronScheduler.next time and return result of block calculation.

doOnceLocal
Link copied to clipboard
common
inline suspend fun <T> KronScheduler.doOnceLocal(noinline block: suspend (DateTime) -> T): T

Execute block once at the KronScheduler.next time and return result of block calculation.

doOnceTz
Link copied to clipboard
common
inline suspend fun <T> KronScheduler.doOnceTz(noinline block: suspend (DateTimeTz) -> T): T

Execute block once at the KronScheduler.next time and return result of block calculation.

doWhile
Link copied to clipboard
common
inline suspend fun KronScheduler.doWhile(noinline block: suspend () -> Boolean)

Will execute block while it will return true as a result of its calculation

doWhileLocal
Link copied to clipboard
common
inline suspend fun KronScheduler.doWhileLocal(noinline block: suspend (DateTime) -> Boolean)

Will execute block while it will return true as a result of its calculation

doWhileTz
Link copied to clipboard
common
inline suspend fun KronScheduler.doWhileTz(noinline block: suspend (DateTimeTz) -> Boolean)

Will execute block while it will return true as a result of its calculation

next
Link copied to clipboard
common
suspend fun KronScheduler.next(relatively: DateTimeTz): DateTimeTz?
nextOrNow
Link copied to clipboard
common
suspend fun KronScheduler.nextOrNow(): DateTime
nextOrRelative
Link copied to clipboard
common
suspend fun KronScheduler.nextOrRelative(relatively: DateTime = DateTime.now()): DateTime
nextTimeZoned
Link copied to clipboard
common
suspend fun KronScheduler.nextTimeZoned(): DateTimeTz?
plus
Link copied to clipboard
common
operator fun KronScheduler.plus(kronScheduler: KronScheduler): CollectionKronScheduler

Sources

common source
Link copied to clipboard