jetty-eventsource-servlet
jetty-eventsource-servlet copied to clipboard
Add support for Last-Event-ID
Adds support for Last-Event-ID. This is two fold. First the, ability to send an event id to the client is added. Second, a new method is added that is called with the Last-Event-ID if a connection is resumed.
This implementation has the limitation that the id has to be set before data or a generic event is sent. This is because these two methods currently finish a message (CRLF CRLF flush). Two alternatives would be to either overload these two methods or introduce a dedicated method that finishes a message. They both seem less attractive.
- Add EventSource#onResume
- Add Emitter#id