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

withoutclass

01/08/2019, 4:04 PM
I am building out a batch processor. I want to be able to control the number of concurrent operations using actors. I made a small test below to prove out my idea, but I want to see if there’s as simpler solution that I’ve overlooked or improvement to be made. Basically I’ll be looking to have a list of actors sized based on an ENV variable, and want to make sure that work is distributed as actors become free from processing.
t

Tolriq

01/08/2019, 8:45 PM
What you ask for looks a lot like a WorkerPool in coroutine world 🙂 You can see https://gist.github.com/Tolriq/dcbdc62c0e29d3b321034e990c3c85ce for an example of a worker pool.
👍 1
6 Views