withoutclass
12/05/2018, 6:56 PMcoroutineScope{} style of method2, sending is always suspended waiting on a receiver, but method1 does not get suspended(blocked).
As far as I can tell, both method 1 and method2 would launch using the same dispatcher (Dispatchers.IO), and that I'm not doing anything "wrong" per se, but clearly I am given I would expect method1 to not get stuck.withoutclass
12/05/2018, 9:05 PMCoroutineScope(coroutineContext) in method2, the code does not block execution. If I use GlobalScope.launch(coroutineContext), the code does not block execution.withoutclass
12/05/2018, 9:43 PMCoroutineScope(coroutineContext).launch, given it uses parent context and dispatcher without actually blocking the execution of the function launching ituli
12/06/2018, 11:08 AMsend to complete. Only then will method2 return the channel.
Now send will not complete until there is a recever...withoutclass
12/06/2018, 3:08 PMwithoutclass
12/06/2018, 3:24 PMwithoutclass
12/06/2018, 3:25 PMmethod calls launch child coroutines using coroutineScope or 2. Providing the channel to the method call instead of having the method return a new channelwithoutclass
12/06/2018, 3:26 PMmethod2 suspendingwithoutclass
12/06/2018, 3:38 PMwithoutclass
12/06/2018, 3:39 PMmethod1 and method2 should just be producers from a design perspective?