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

zokipirlo

12/04/2018, 8:50 AM
I'm new to coroutines and need some help please. On coroutineContext I'm running one while loop (start function, with blocking api call) and also actor which serves to send packets (api call also). Are those api calls wait for each other or can they run in parallel? Sample code: https://goo.gl/a87Vs9
g

gildor

12/04/2018, 9:05 AM
They can run in parallel. Looks fine for me. You can check it yourself if add some logic and logging
but launch isActive is not necessary if you have suspend function call (but may be useful in some more complicated cases)
also you don’t need
coroutineContext
in actor builder
same for launch
z

zokipirlo

12/04/2018, 9:08 AM
thank you very much 👏🏻🍺
it's so much simpler and easier to understand than write that in java with executors and arrayblockingqueues 😅