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

Timur Atakishiev

03/04/2020, 3:13 PM
Hi all. Imagine I have a server that is adding an objects to queue continuously and I have a n-amount of threads that taking an object from queue, does some computation and saving result to database. Is it possible to do the task in the same way with coroutines, and if it is can someone help me please?
z

Zach Klippenstein (he/him) [MOD]

03/04/2020, 5:43 PM
Sounds like something a worker pool would be good for. You can use a channel for the queue, and spin up
n
coroutines to read from the channel.
2 Views