Skip to content

Instantly share code, notes, and snippets.

@lankydan lankydan/Server.kt
Created Aug 12, 2019

What would you like to do?
Corda + Ktor - gracefully disconnecting from node
fun NettyApplicationEngine.addShutdownHook() {
Runtime.getRuntime().addShutdownHook(Thread {
stop(1, 1, TimeUnit.SECONDS)
fun Application.addShutdownEvent(connection: CordaRPCConnection) {
environment.monitor.subscribe(ApplicationStopped) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.