diff --git a/src/commonMain/kotlin/dev/inmo/krontab/utils/SchedulerFlow.kt b/src/commonMain/kotlin/dev/inmo/krontab/utils/SchedulerFlow.kt index 17b1c57..61d4e46 100644 --- a/src/commonMain/kotlin/dev/inmo/krontab/utils/SchedulerFlow.kt +++ b/src/commonMain/kotlin/dev/inmo/krontab/utils/SchedulerFlow.kt @@ -3,8 +3,8 @@ package dev.inmo.krontab.utils import com.soywiz.klock.DateTime import com.soywiz.klock.DateTimeTz import com.soywiz.klock.milliseconds -import dev.inmo.krontab.* -import kotlinx.coroutines.FlowPreview +import dev.inmo.krontab.KronScheduler +import dev.inmo.krontab.next import kotlinx.coroutines.currentCoroutineContext import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow @@ -20,7 +20,6 @@ import kotlinx.coroutines.isActive * * @param since Will be used as the first parameter for [KronScheduler.next] fun */ -@FlowPreview fun KronScheduler.asTzFlowWithoutDelays(since: DateTimeTz = DateTime.nowLocal()): Flow = flow { var previous = since while (currentCoroutineContext().isActive) { @@ -35,7 +34,6 @@ fun KronScheduler.asTzFlowWithoutDelays(since: DateTimeTz = DateTime.nowLocal()) * * This [Flow] will use [asTzFlowWithoutDelays], but stop on each time until this time will happen */ -@FlowPreview fun KronScheduler.asTzFlowWithDelays(): Flow = asTzFlowWithoutDelays().onEach { futureHappenTime -> val now = DateTime.nowLocal() @@ -51,7 +49,6 @@ fun KronScheduler.asTzFlowWithDelays(): Flow = asTzFlowWithoutDelays "Behaviour will be changed. In some of near versions this flow will not delay executions", ReplaceWith("this.asTzFlowWithDelays()", "dev.inmo.krontab.utils.asTzFlowWithDelays") ) -@FlowPreview fun KronScheduler.asTzFlow(): Flow = asTzFlowWithDelays() /** @@ -62,7 +59,6 @@ fun KronScheduler.asTzFlow(): Flow = asTzFlowWithDelays() * * @param since Will be used as the first parameter for [KronScheduler.next] fun */ -@FlowPreview fun KronScheduler.asFlowWithoutDelays(since: DateTime = DateTime.now()): Flow = flow { var previous = since while (currentCoroutineContext().isActive) { @@ -77,7 +73,6 @@ fun KronScheduler.asFlowWithoutDelays(since: DateTime = DateTime.now()): Flow = asFlowWithoutDelays().onEach { futureHappenTime -> val now = DateTime.now() @@ -93,5 +88,4 @@ fun KronScheduler.asFlowWithDelays(): Flow = asFlowWithoutDelays().onE "Behaviour will be changed. In some of near versions this flow will not delay executions", ReplaceWith("this.asFlowWithDelays()", "dev.inmo.krontab.utils.asFlowWithDelays") ) -@FlowPreview fun KronScheduler.asFlow(): Flow = asFlowWithDelays()