dave08
12/06/2017, 3:37 AMsuspend fun getX()
needs to be able to be run either in main thread context using CommonPool
, or in an existing coroutineContext
or in an already existing worker thread in a blocking fashion, depending on from where it's called, what's the recommended way to do each, and when would I have to yield
?elizarov
12/06/2017, 8:11 AMsuspend fun getX()
as you would normally do and delegate decision on what context to run it in to its caller.dave08
12/06/2017, 8:18 AMgetX()
in my case is the channel.send(parsedApiActions)
, that is supposed to dispatch actions to the channel that will fan out to handlers and fan in again for results, the results need to be recieved on the current thread but the processing is done in a thread pool...elizarov
12/06/2017, 8:21 AMsend
should not be even remotely concerned about that.