@Override public void onOpen(final EventSource.Emitter emitter) throws IOException { poller.subscribe(this); emitter.event("test", "Event source opened"); System.out.println("opened"); while (true) { emitInit(emitter); emitMove(emitter); emitStatus(emitter); emitTower(emitter); emitEvent(emitter); } }
@Override protected EventSource newEventSource(HttpServletRequest request) { SSEEventSource eventSource = new SSEEventSource(jobUpdateToSSERelay); jobUpdateToSSERelay.addListener(eventSource, userFactory.provide()); return eventSource; }
@Override protected EventSource newEventSource(final HttpServletRequest req) { return new DataSource(consumer); }