withoutclass
01/30/2018, 4:16 PMlaunch {
whileSelect {
channel.onReceive {
when (it) {
// do stuff
}
}
}
}
elizarov
01/30/2018, 8:59 PMwhileSelect
here. Use for (msg in channel)
withoutclass
01/30/2018, 9:02 PMfor (msg in channel)
will stop looping once there are no events though, correct? I want to continue listening on the channel even if there are 0 events.elizarov
01/30/2018, 9:46 PMwithoutclass
01/30/2018, 9:49 PMonClick { channel.send(event) }
. It works very well, though maybe I’m doing it incorrectly.elizarov
01/30/2018, 9:50 PMfor
loop does.withoutclass
01/30/2018, 9:53 PM