protected TryableSemaphore getFallbackSemaphore ( ) { if ( fallbackSemaphoreOverride == null ) { TryableSemaphore _s = fallbackSemaphorePerCircuit . get ( commandKey . name ( ) ) ; if ( _s == null ) { // we didn't find one cache so setup fallbackSemaphorePerCircuit . putIfAbsent ( commandKey . name ( ) , new TryableSemaphoreActual ( properties . fallbackIsolationSemaphoreMaxConcurrentRequests ( ) ) ) ; // assign whatever got set (this or another thread) return fallbackSemaphorePerCircuit . get ( commandKey . name ( ) ) ; } else { return _s ; } } else { return fallbackSemaphoreOverride ; } }
Get the TryableSemaphore this HystrixCommand should use if a fallback occurs .