@ Override @ SuppressWarnings ( "checkstyle:illegalcatch" ) public void onNext ( final T value ) { beforeOnNext ( ) ; try { executor . submit ( new Runnable ( ) { @ Override public void run ( ) { try { handler . onNext ( value ) ; } catch ( final Throwable t ) { if ( errorHandler != null ) { errorHandler . onNext ( t ) ; } else { LOG . log ( Level . SEVERE , name + " Exception from event handler" , t ) ; throw t ; } } finally { afterOnNext ( ) ; } } } ) ; } catch ( final Exception e ) { LOG . log ( Level . SEVERE , "Encountered error when submitting to executor in ThreadPoolStage." ) ; afterOnNext ( ) ; throw e ; } }
Handles the event using a thread in the thread pool .