https://kotlinlang.org logo
Title
y

ylemoigne

10/07/2019, 6:59 AM
I must have misunderstood something. Can anyone explain to me why this is blocking and the
println("Start receiving...
is not executed ? (or point me to the revelant part of documentation)
o

octylFractal

10/07/2019, 7:03 AM
opening a
coroutineScope
block will suspend until all coroutines started in it finish executing, as part of structured concurrency
what you probably wanted here was to create:
fun CoroutineScope.doJob() = produce {
  println("Launch ${Thread.currentThread()}")
  for (i ...) {
    ...
  }
  // no close required
}
y

ylemoigne

10/07/2019, 7:05 AM
ho ok, did not unterstand this part CSP. Thanks you, I'll rework my design with that in mind.
Thanks for the
produce
, I'll take a look