Mauricio Barbosa
01/19/2020, 4:52 PMDoing first request
retrieving first request
Exception in thread "main" kotlinx.coroutines.JobCancellationException: Parent job is Completed; job=ScopeCoroutine{Completed}@383534aa
Has someone any ideia of what am I doing wrong?Adam Powell
01/19/2020, 4:57 PMcoroutineScope
and flow
in your nesting at the beginning of composedRequest()
. You want the flow to have a scope, you don't want to have a scope for constructing the flow.coroutineScope
is completed by the time composedRequest
returns the new flow object, so when you collect
it you're trying to use async
to launch child coroutines of a parent that isn't active anymoreMauricio Barbosa
01/19/2020, 5:18 PMasync
inside flow. So, what’s the correct approach? Can I encapsulate async
inside a coroutineScope
?Adam Powell
01/19/2020, 5:20 PMcoroutineScope
and the call to flow {}
suspend
from composedRequest
Mauricio Barbosa
01/19/2020, 5:36 PM