Skip to content

Instantly share code, notes, and snippets.

@jaozinfs
Last active March 18, 2021 13:51
Show Gist options
  • Save jaozinfs/c314f853dbddcc860cd80ef80f37643a to your computer and use it in GitHub Desktop.
Save jaozinfs/c314f853dbddcc860cd80ef80f37643a to your computer and use it in GitHub Desktop.
val hotChannelExemple = Channel<String>()
launch {
hotChannelExemple.send("um")
hotChannelExemple.send("dois")
hotChannelExemple.send("três")
hotChannelExemple.send("quatro")
}
repeat(2) { println("Collector 1 ${hotChannelExemple.receive()}") }
println("--")
repeat(2) { println("Collector 1 ${hotChannelExemple.receive()}") }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment