Skip to content

Instantly share code, notes, and snippets.

@jaozinfs
Created March 18, 2021 16:35
Show Gist options
  • Save jaozinfs/0bd12d00783b75436247a0159d904593 to your computer and use it in GitHub Desktop.
Save jaozinfs/0bd12d00783b75436247a0159d904593 to your computer and use it in GitHub Desktop.
val coldFlowExemple = (1..3).asFlow()
coldFlowExemple.onEach {
println("delay")
delay(300)
}.collect { value ->
println("Collector 1 - ${value}")
}
println("--")
coldFlowExemple.collect { value -> println("Collector 2 - ${value}") }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment