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

Link copied to clipboard
abstract suspend fun next(relatively: <ERROR CLASS> = DateTime.now()): <ERROR CLASS>?

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
fun KronScheduler.asFlow(): <ERROR CLASS><<ERROR CLASS>>

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

Link copied to clipboard
fun KronScheduler.asTzFlow(): <ERROR CLASS><<ERROR CLASS>>

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

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

Will execute block without any checking of result

Link copied to clipboard
inline suspend fun KronScheduler.doInfinityTz(noinline block: suspend (<ERROR CLASS>) -> Unit)

Will execute block without any checking of result

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

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

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

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

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

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

Link copied to clipboard
inline suspend fun KronScheduler.doWhileTz(noinline block: suspend (<ERROR CLASS>) -> Boolean)

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

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

Sources

Link copied to clipboard