mirror of
https://github.com/InsanusMokrassar/krontab.git
synced 2024-11-23 02:28:52 +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
|
package com.github.insanusmokrassar.krontab
|
||||||
|
|
||||||
suspend inline fun executeWith(
|
suspend inline fun CronDateTimeScheduler.executeInfinity(noinline block: suspend () -> Unit) = doInLoop {
|
||||||
scheduler: CronDateTimeScheduler,
|
|
||||||
noinline block: suspend () -> Boolean
|
|
||||||
) = scheduler.doInLoop(block)
|
|
||||||
|
|
||||||
suspend inline fun executeInfinity(
|
|
||||||
scheduleConfig: String,
|
|
||||||
noinline block: suspend () -> Unit
|
|
||||||
) = createCronDateTimeScheduler(scheduleConfig).doInLoop {
|
|
||||||
block()
|
block()
|
||||||
true
|
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(
|
suspend inline fun executeWhile(
|
||||||
scheduleConfig: String,
|
scheduleConfig: String,
|
||||||
noinline block: suspend () -> Boolean
|
noinline block: suspend () -> Boolean
|
||||||
) = createCronDateTimeScheduler(scheduleConfig).doInLoop(block)
|
) = createCronDateTimeScheduler(scheduleConfig).executeWhile(block)
|
||||||
|
|
||||||
suspend inline fun executeOnce(
|
suspend inline fun CronDateTimeScheduler.executeOnce(noinline block: suspend () -> Unit) = doInLoop {
|
||||||
scheduleConfig: String,
|
|
||||||
noinline block: suspend () -> Unit
|
|
||||||
) = createCronDateTimeScheduler(scheduleConfig).doInLoop {
|
|
||||||
block()
|
block()
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
suspend inline fun executeOnce(
|
||||||
|
scheduleConfig: String,
|
||||||
|
noinline block: suspend () -> Unit
|
||||||
|
) = createCronDateTimeScheduler(scheduleConfig).executeOnce(block)
|
||||||
|
Loading…
Reference in New Issue
Block a user