use of org.springframework.web.servlet.mvc.method.annotation.SseEmitter in project spring-boot-admin by codecentric.
the class JournalController method getJournalEvents.
@RequestMapping(produces = "text/event-stream")
public SseEmitter getJournalEvents() {
final SseEmitter emitter = new SseEmitter();
emitter.onCompletion(new Runnable() {
@Override
public void run() {
emitters.remove(emitter);
}
});
emitters.add(emitter);
return emitter;
}
Aggregations