Untitled.kt
# coroutines
j
Untitled.kt
k
If you only return 1 item I'd use a
CompletableDeferred
instead of a channel.
j
My goal is to create a channel-based solution, without handler and consumer knowing each other
I don't know how could I archieve this with CompletableDeferred
k
This might be unethical code (I don't really know what is considered bad practice yet) but would this do what you want?
j
probably, though I think I found a way
k
job.join() shouldn't be needed I think
j
hmm, you're right
coroutineScope should wait for all its children