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
gildor
12/04/2018, 9:06 AM
but launch isActive is not necessary if you have suspend function call (but may be useful in some more complicated cases)
gildor
12/04/2018, 9:07 AM
also you don’t need
coroutineContext
in actor builder
gildor
12/04/2018, 9:07 AM
same for launch
z
zokipirlo
12/04/2018, 9:08 AM
thank you very much 👏🏻🍺
zokipirlo
12/04/2018, 9:09 AM
it's so much simpler and easier to understand than write that in java with executors and arrayblockingqueues 😅