library/Odesk/Phystrix/CircuitBreakerFactory.php
public function get($commandKey, Config $commandConfig, CommandMetrics $metrics)
    {
        if (!isset($this->circuitBreakersByCommand[$commandKey])) {
            $circuitBreakerConfig = $commandConfig->get('circuitBreaker');
            if ($circuitBreakerConfig->get('enabled')) {
                $this->circuitBreakersByCommand[$commandKey] =
                    new CircuitBreaker($commandKey, $metrics, $commandConfig, $this->stateStorage);
            } else {
                $this->circuitBreakersByCommand[$commandKey] = new NoOpCircuitBreaker();
            }
        }

        return $this->circuitBreakersByCommand[$commandKey];
    }
public function get($commandKey, Config $commandConfig, CommandMetrics $metrics)
    {
        if (!isset($this->circuitBreakersByCommand[$commandKey])) {
            $circuitBreakerConfig = $commandConfig->get('circuitBreaker');
            if ($circuitBreakerConfig->get('enabled')) {
                $this->circuitBreakersByCommand[$commandKey] =
                    new CircuitBreaker($commandKey, $metrics, $commandConfig, $this->stateStorage);
            } else {
                $this->circuitBreakersByCommand[$commandKey] = new NoOpCircuitBreaker();
            }
        }

        return $this->circuitBreakersByCommand[$commandKey];
    }
public function get ( $ commandKey , Config $ commandConfig , CommandMetrics $ metrics ) { if ( ! isset ( $ this -> circuitBreakersByCommand [ $ commandKey ] ) ) { $ circuitBreakerConfig = $ commandConfig -> get ( 'circuitBreaker' ) ; if ( $ circuitBreakerConfig -> get ( 'enabled' ) ) { $ this -> circuitBreakersByCommand [ $ commandKey ] = new CircuitBreaker ( $ commandKey , $ metrics , $ commandConfig , $ this -> stateStorage ) ; } else { $ this -> circuitBreakersByCommand [ $ commandKey ] = new NoOpCircuitBreaker ( ) ; } } return $ this -> circuitBreakersByCommand [ $ commandKey ] ; }
Get circuit breaker instance by command key for given command config

@param string $commandKey
@param Config $commandConfig
@param CommandMetrics $metrics
@return CircuitBreakerInterface
Get circuit breaker instance by command key for given command config