im not precisely sure what your asking for here bu...
# coroutines
g
im not precisely sure what your asking for here but a couple notes: 1. abandoned coroutines are perfectly legal, as the coroutine implementation itself is simply a closure on a state machine, if no closure exists on the object graph then the whole thing will simply get GC'd half way through. Consider a
channel.recieve()
call when the
channel
drops out of scope, the whole coroutine will simply never be resumed and its memory will be reclaimed 2. I presume that if you convert a particular
ExecutorService
to a coroutine dispatcher, and then call
executorService.shutdown()
it will simply mean nobody can get rescheduled with it, in effect causing all of the coroutines dispatched with it to become abandoned => GC'd