We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32447f9 commit 35674d4Copy full SHA for 35674d4
reactive/kotlinx-coroutines-rx2/src/RxScheduler.kt
@@ -53,9 +53,7 @@ private class DispatcherScheduler(val dispatcher: CoroutineDispatcher) : Schedul
53
if (!scope.isActive) return Disposables.disposed()
54
val newBlock = RxJavaPlugins.onSchedule(block)
55
return scope.launch {
56
- if (delay > 0) {
57
- delay(unit.toMillis(delay))
58
- }
+ delay(unit.toMillis(delay))
59
newBlock.run()
60
}.asDisposable()
61
}
@@ -97,7 +95,7 @@ private class DispatcherScheduler(val dispatcher: CoroutineDispatcher) : Schedul
97
95
val taskJob = Job(workerJob)
98
96
val task = SchedulerChannelTask(newBlock, taskJob)
99
100
- if (delay == 0L) {
+ if (delay <= 0L) {
101
blockChannel.offer(task)
102
} else {
103
// Use `taskJob` as the parent here so the delay will also get cancelled if the Disposable
0 commit comments