liamsorsby/php-hystrix

PHP implemention of Hystrix

v0.1 2020-01-30 20:00 UTC

This package is auto-updated.

Last update: 2024-04-29 04:15:41 UTC


README

Build Status codecov Scrutinizer Code Quality Build Status Code Intelligence Status Quality Gate Status

Circuit Breaker

This is an example repo that provides basic circuit breaking capabilities

Supported Caches

  1. APC
  2. Redis
  3. RedisArray
  4. RedisCluster
  5. Memcached

Examples

$cb = $factory->create(StorageFactory::APC, []);

try {
    if(!$cb->isOpen()) {
        // do something
        return;
    }
    // Transactional or complex operation
} catch (Exception $e) {
    $cb->reportFailure('');
    // log error from $e->getMessage()
}

More examples can be found in the examples directory