other than keeping a blocking queue manually, disp...
# coroutines
u
other than keeping a blocking queue manually, dispatcher abstraction is meant for this I think
Just start a coroutine for each upload and have each coroutine attempt to acquire the semaphore before starting the actual upload process.
☝️ 1
u
Well ok. but I meant sharing the threads between disparchers basically
m
Just launch 5 coroutines on IO dispatcher, have them all read from one channel with download tasks/urls and that's all
You'll never use more than 5 threads and no threads will be kept alive just to idle
Roman had a talk on last KotlinConf showcasing solution for just this problem
This one

https://youtu.be/a3agLJQ6vt8

u
thanks!