liamsorsby/php-hystrix

PHP实现的Hystrix

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

This package is auto-updated.

Last update: 2024-09-29 05:29:06 UTC


README

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

断路器

这是一个提供基本断路器功能的示例仓库

支持的缓存

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

示例

$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()
}

更多示例可以在示例目录中找到