Luke Rohde
10/22/2019, 2:19 PMticker
, but it’s marked as obsolete and it’s unclear whymarstran
10/22/2019, 2:34 PMNote: Ticker channels are not currently integrated with structured concurrency and their api will change in the future.
withoutclass
10/22/2019, 2:49 PMrepeat
with delay
or a coroutine with a loop that checks isActive
+ delay
bdawg.io
10/22/2019, 3:57 PMFlow
with an indefinite generator with a delay if you want it as a streamDennis Schröder
10/23/2019, 7:01 AMsuspend fun periodicTask(
period: Long,
context: CoroutineContext = EmptyCoroutineContext,
task: suspend CoroutineScope.() -> Unit
) = withContext(context) {
while (true) {
delay(period)
task()
}
}
uli
10/23/2019, 7:30 AM