https://kotlinlang.org logo
#coroutines
Title
# coroutines
a

Allan Wang

06/07/2019, 5:58 PM
Is there a reason why there aren’t delay functions for channels, and only for flows? https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/common/src/flow/operators/Delay.kt Is it just that it isn’t as efficient to do so with hot streams?
e

elizarov

06/07/2019, 6:38 PM
It quickly becomes inefficient when you apply multiple operators to channel, so the pattern we want to enforce is that you take your input as flow, apply flow operators, then convert the result to the channel (
produceIn
operator) if channel is needed.
4 Views