is there any way to poll/receive from a channel wi...
# coroutines
is there any way to poll/receive from a channel without consuming the element? like peeking at the front of a queue
Nope. Could you please elaborate why do you need it?
I'm trying to invoke a method as soon as a message is received in a channel, but without actually caring what the message is - so that I can consume the message later. It's hard to explain - that's probably because I just designed it poorly
@Daniel Tam Maybe you need to use two channels, one for each purpose (notifying, and consuming)? Or use one channel, and some custom logic?
Yea you could use a relay type situation where you
consumes the element in order to kick your functionality, then sends the element down another channel for later consumption. Alternatively use a broadcast channel so two different things can open a subscription and both receive all elements.
Ah I do like the idea of a broadcast channel