mirror of
https://github.com/InsanusMokrassar/krontab.git
synced 2024-11-22 16:23:55 +00:00
now all executes can be applyed to CronDateTimeScheduler
This commit is contained in:
parent
d1a2b20792
commit
d1f84ee136
@ -1,27 +1,25 @@
|
||||
package com.github.insanusmokrassar.krontab
|
||||
|
||||
suspend inline fun executeWith(
|
||||
scheduler: CronDateTimeScheduler,
|
||||
noinline block: suspend () -> Boolean
|
||||
) = scheduler.doInLoop(block)
|
||||
|
||||
suspend inline fun executeInfinity(
|
||||
scheduleConfig: String,
|
||||
noinline block: suspend () -> Unit
|
||||
) = createCronDateTimeScheduler(scheduleConfig).doInLoop {
|
||||
suspend inline fun CronDateTimeScheduler.executeInfinity(noinline block: suspend () -> Unit) = doInLoop {
|
||||
block()
|
||||
true
|
||||
}
|
||||
suspend inline fun executeInfinity(
|
||||
scheduleConfig: String,
|
||||
noinline block: suspend () -> Unit
|
||||
) = createCronDateTimeScheduler(scheduleConfig).executeInfinity(block)
|
||||
|
||||
suspend inline fun CronDateTimeScheduler.executeWhile(noinline block: suspend () -> Boolean) = doInLoop(block)
|
||||
suspend inline fun executeWhile(
|
||||
scheduleConfig: String,
|
||||
noinline block: suspend () -> Boolean
|
||||
) = createCronDateTimeScheduler(scheduleConfig).doInLoop(block)
|
||||
) = createCronDateTimeScheduler(scheduleConfig).executeWhile(block)
|
||||
|
||||
suspend inline fun executeOnce(
|
||||
scheduleConfig: String,
|
||||
noinline block: suspend () -> Unit
|
||||
) = createCronDateTimeScheduler(scheduleConfig).doInLoop {
|
||||
suspend inline fun CronDateTimeScheduler.executeOnce(noinline block: suspend () -> Unit) = doInLoop {
|
||||
block()
|
||||
false
|
||||
}
|
||||
suspend inline fun executeOnce(
|
||||
scheduleConfig: String,
|
||||
noinline block: suspend () -> Unit
|
||||
) = createCronDateTimeScheduler(scheduleConfig).executeOnce(block)
|
||||
|
Loading…
Reference in New Issue
Block a user