elizarov
12/05/2017, 7:31 AMSendChannel
for that (it is hard to consistently define for an arbitrary SendChannel
), but parent job gives that too. You can do:
val parent = Job()
val actor1 = actor(parent = parent) { ... }
...
val actorN = actor(parent = parent) { ... }
...
parent.cancelAndJoin() // cancel all actors and wait for all of them to complete