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

Yashdeep Patel

03/04/2020, 4:10 PM
Is there a way to add suspended functions in processing Queue (or similar). I have use case where I am getting different callbacks that updates same entity in database. Instead of execute suspended functions async, I want to execute them in same order that callback was received. Is there a way to do it?
z

Zach Klippenstein (he/him) [MOD]

03/04/2020, 5:45 PM
Sounds like you could make a
Channel<suspend () -> Unit>(UNLIMITED)
and launch a coroutine to read from the channel and invoke the functions one-at-a-time.
t

Thiyagu

03/04/2020, 9:52 PM
3 Views