public static class SSESub implements NginxJavaRingHandler {
@Override
public Object[] invoke(Map<String, Object> request) {
NginxJavaRequest r = (NginxJavaRequest) request;
NginxHandler handler = r.handler();
NginxHttpServerChannel channel = handler.hijack(r, true);
channel.addListener(channel, new ChannelListener<NginxHttpServerChannel>() {
@Override
public void onClose(NginxHttpServerChannel data) {
Init.serverSentEventSubscribers.remove(data);
NginxClojureRT.getLog().info("closing...." + data.request().nativeRequest());