public synchronized void onEvent() throws IOException{
final EventStream eventStream = (Client) request.getSession().getAttribute(clientId);
Notification notification= eventStream.eventAvailable() ? eventStream.take(0) : null;
if (notification != null) { // we are resuming
try {
if (sendEvent(notification, eventStream, serializer)) {
System.err.println("connection closed by server" + request);