I'm not saying it's a real problem for me :slightl...
# coroutines
v
I'm not saying it's a real problem for me 🙂 However, if I needed to send many messages to a channel/actor asynchronously, setting a large channel capacity +
offer
would be the first thing I'd think about. I tried
launch(parent-context) { ch.send(..) }
, but it's very slow.
g
vaskir: why not use an
UNLIMITED
size that gives you a linked-list channel?
v
because I didn't know about it at that time 🙂
btw, do channels use an array by default? How does it even work?..
I mean how messages deleted from it efficiently?
g
I really dont know, but notice that it does have a
Head
pointer, so my guess is that it acts as a circular buffer, meaning "removal" is probably just
array[head] = null; head = head + 1 % size
v
ah, I see. That's great.