private void runDeferredStop ( ) { // Stop current jobs from running. clearWaitJobs ( ) ; // Schedule deferred stop executor. log . trace ( "Ran deferred stop" ) ; if ( deferredStop == null ) { // set deferred stop if we get a job name returned deferredStop = subscriberStream . scheduleWithFixedDelay ( new DeferredStopRunnable ( ) , 100 ) ; } }
Schedule a stop to be run from a separate thread to allow the background thread to stop cleanly .