Are workers as a concept planned for the stable re...
# coroutines
d
Are workers as a concept planned for the stable release of coroutines, or coming later?
i.e. not just constraining concurrency with a
newFixedThreadPoolContext
, but the actual number of coroutines total?
n
Can't you just keep track of the number of coroutines you launch? Or do I misunderstand your issue
e
you want to limit your coroutines or count them?
d
Limit them - it's similar to Roman's KotlinConf presentation. In my case have I a connection pool and an external host I want to limit concurrency to. I want no more than that many workers running. There's an receive channel for keys to load, and an send channel for results - so those workers for loop in the receive channel
Right now, I just for loop a range
1..numWorkers
and
launch(<http://Dispatchers.IO|Dispatchers.IO>)
within the scope I need them to live for
e
isn’t enough for you?
d
Sure, but sounded like there was a plan to support that as a pattern, I guess it's an
actor
?
d
That's the guy! I'll watch that
Cheers