if I have a bunch of actors (each managing a socke...
# coroutines
r
if I have a bunch of actors (each managing a socket forming a connection pool), how do I send a message to a currently non-busy actor? Should I use a concurrent queue for this or is there some channel concept for this?
t
In fact,
Channel
is an actual concurrent queue. It is the coroutines equivalent of
BlockingQueue
. Since you are looking for a way to dispatch work to multiple actors, have a look at the "Fan Out" section of the docs : https://kotlinlang.org/docs/reference/coroutines/channels.html#fan-out
r
Thanks!
now, how would I go about auto-scaling the number of processor coroutines depending on if they are busy?
ah, solved that
t
How did you solve the issue? can you please share the snippet?