stopServerOnCancellation

fun ApplicationEngine.stopServerOnCancellation(): CompletableJob

Stop server on job cancellation. The returned deferred need to be completed or cancelled.