napperley
08/01/2022, 1:12 AMsimon.vergauwen
08/01/2022, 6:51 AMemebeddedServer
on the CoroutineScope
and it will cancel/shutdown gracefully on `SIGINT`/`SIGTERM` etc.
Not just playing nice in the terminal, but also playing nice with Kubernetes and containers etc.
https://youtrack.jetbrains.com/issue/KTOR-4427/CoroutineScopeembeddedServer-graceful-shutdownResource
and reason about graceful shutdown in terms of structured concurrency.
It’s being developed outside of the Ktor context, since it’s also interesting to use in combination with for example Kafka streaming if you want to guarantee offsets being committed before shutdown on SIGINT
or another shutdown signal.alpha
release which is published on Maven Central.