mirror of
https://github.com/InsanusMokrassar/krontab.git
synced 2024-11-22 08:13:54 +00:00
fix of #35
This commit is contained in:
parent
8ac6cd3e62
commit
2abef58335
@ -0,0 +1,13 @@
|
||||
package dev.inmo.krontab
|
||||
|
||||
import com.soywiz.klock.DateTime
|
||||
|
||||
class LambdaKronScheduler(
|
||||
private val onNext: suspend (DateTime) -> DateTime?
|
||||
) : KronScheduler {
|
||||
override suspend fun next(relatively: DateTime): DateTime? = onNext(relatively)
|
||||
}
|
||||
|
||||
fun KronScheduler(
|
||||
onNext: suspend (DateTime) -> DateTime?
|
||||
) = LambdaKronScheduler(onNext)
|
@ -0,0 +1,13 @@
|
||||
package dev.inmo.krontab
|
||||
|
||||
import com.soywiz.klock.DateTimeTz
|
||||
|
||||
class LambdaKronSchedulerTz(
|
||||
private val onNext: suspend (DateTimeTz) -> DateTimeTz?
|
||||
) : KronSchedulerTz {
|
||||
override suspend fun next(relatively: DateTimeTz): DateTimeTz? = onNext(relatively)
|
||||
}
|
||||
|
||||
fun KronSchedulerTz(
|
||||
onNext: suspend (DateTimeTz) -> DateTimeTz?
|
||||
) = LambdaKronSchedulerTz(onNext)
|
Loading…
Reference in New Issue
Block a user