https://kotlinlang.org logo
Title
m

Matt Thiffault

10/09/2019, 10:32 PM
Channel Question: How do I suspend while waiting for a message from a channel that matches a predicate, in a repeatable way? When I use ReceiveChannel.first{} or ReceiveChannel.consumeAsFlow().first {} more than once, the second one throws an exception saying channel cancelled and no items in flow respectively.
d

Dominaezzz

10/09/2019, 10:54 PM
while loop?
r

Ruckus

10/09/2019, 11:05 PM
#coroutines would be a better place to ask
m

Matt Thiffault

10/09/2019, 11:05 PM
Ah, cool, haven't used slack much and didn't realize there were more channels than what is showed in the side bar by default.
👍 1