https://kotlinlang.org logo
#coroutines
Title
# coroutines
r

rrva

01/03/2020, 1:02 PM
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

tseisel

01/03/2020, 1:09 PM
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

rrva

01/03/2020, 2:54 PM
Thanks!
now, how would I go about auto-scaling the number of processor coroutines depending on if they are busy?
ah, solved that
t

Thiyagu

01/04/2020, 7:15 PM
How did you solve the issue? can you please share the snippet?