@ Subscribe public void updateThrottleState ( ThrottleState throttleState ) { // Only run if throttling is enabled. if ( ! throttlingAllowed ) { return ; } // check if we are throttled final boolean throttled = determineIfThrottled ( throttleState ) ; if ( currentlyThrottled . get ( ) ) { // no need to unblock if ( throttled ) { return ; } // sanity check if ( blockLatch == null ) { log . error ( "Expected to see a transport throttle latch, but it is missing. This is a bug, continuing anyway." ) ; return ; } currentlyThrottled . set ( false ) ; handleChangedThrottledState ( false ) ; blockLatch . countDown ( ) ; } else if ( throttled ) { currentlyThrottled . set ( true ) ; handleChangedThrottledState ( true ) ; blockLatch = new CountDownLatch ( 1 ) ; } }
Only executed if the Allow Throttling checkbox is set in the input s configuration .