public void shutdown ( ) { if ( open == 0 || shutdown ) { return ; } shutdown = true ; sink . getIoThread ( ) . execute ( new Runnable ( ) { @ Override public void run ( ) { synchronized ( ServerSentEventConnection . this ) { if ( queue . isEmpty ( ) && pooled == null ) { exchange . endExchange ( ) ; } } } } ) ; }
execute a graceful shutdown once all data has been sent