Hi.
Is there any zero-capacity channels that always can
send
without suspension?
It seems
Channel(0)#send
will suspend unless any receivers are consuming values.
It is okay if values will be lost when no receivers are consuming.
b
bdawg.io
09/04/2019, 3:58 PM
So you want a rendezvous channel that only facilitates a rendezvous initiated by the receiver (instead of the sender)?
j
jw
09/04/2019, 3:58 PM
Sounds like a conflated broadcast channel
d
Dominaezzz
09/04/2019, 3:58 PM
Conflate!
Dominaezzz
09/04/2019, 3:59 PM
Or just use
offer
.
👍 2
e
elizarov
09/04/2019, 4:03 PM
You should use
offer
. then depending on channel capacity:
CONFLATED
-> offer always returns true, receiver is guaranteed to get the most recent value.
RENDEZVOUS
-> offer returns false when receiver is not waiting, the value is lost.
k
kawmra
09/04/2019, 4:18 PM
Thanks everyone,
RENDEZVOUS
Channel’s
offer
is exactly the one I was looking for!
I was considered using conflated channels, but that channel has at most one buffer so receivers will be received value when start consuming.