vert-x3 / vertx-lang-kotlin

Vert.x for Kotlin
Apache License 2.0
296 stars 68 forks source link

Cancel child coroutines when undeploying a coroutine verticle #205

Closed cyber-barrista closed 3 years ago

cyber-barrista commented 3 years ago

Motivation:

This PR addresses https://github.com/vert-x3/vertx-lang-kotlin/issues/189. Up until now, any child coroutine launched from a coroutine verticle has been left uncanceled (even if it adheres to the coroutine "cooperative" concurrency principle). That would cause "process leaks".

Solution:

Explicit specification of the Job the coroutine verticle is running upon and explicit cancelation of this job within the stop method.

vietj commented 3 years ago

thanks!