kwik
kwik copied to clipboard
ServerConnector.shutdown?
After a ServerConnector instance is started, how to shut down the instance?
Agree we need a shutdown method on ServerConnector.
To add, would be nice if it implemented AutoCloseable
In my case, helps integration as a bean with DI framework, maybe its nice to be able to close a ServerConnector with try-with-resources as follows:
try (ServerConnector connector = ServerConnector.builder()
...
.build()) {
connector.registerApplicationProtocol(...);
connector.start();
// perform operation that interfaces with connector.
// when scope is exit, server is gone
}
and implementation is just to make shutdown method in impl, as void close() throws Exception;, and have ServerConnector extend AutoCloseable.
Implemented in release 0.9.1