Closed ngocdaothanh closed 7 years ago
Added xitrum.Server.stopAtShutdown
to register a JVM shutdown hook that calls [[stop]] to stop Xitrum gracefully.
After the hook has been registered, you can stop Xitrum gracefully by running OS command:
kill <Xitrum PID>
Currently xitrum.Server.stop doesn't wait for the servers to be actually stopped, and it returns
void
.It's impossible for the caller to know when Xitrum will stop.
Workaround:
When starting Xitrum, remember the EventLoopGroup of the HTTP and/or HTTPS servers that Xitrum starts:
Then, to stop Xitrum gracefully:
Then, wait the the futures to complete:
The above should not be called in Xitrum action thread to avoid deadlock.