pixelfederation / phystrix-redis
Phystrix 的 Redis 存储实现 (https://github.com/upwork/phystrix)
1.0.2
2020-09-02 12:33 UTC
Requires
- php: >=7.1
- odesk/phystrix: ^1.0|^2.0
- predis/predis: ^1.1
This package is auto-updated.
Last update: 2024-08-29 04:31:31 UTC
README
Phystrix 的 Redis 存储实现 (https://github.com/upwork/phystrix) 它使用了 predis/predis 包。
用法
需要 redis 状态存储库
composer require pixelfederation/phystrix-redis
创建 \PixelFederation\Phystrix\Storage\RedisStateStorage
的新实例,并将其注入到 \Odesk\Phystrix\CommandMetricsFactory
和 \Odesk\Phystrix\CircuitBreakerFactory
与 Symfony 框架一起使用
安装 Redis Bundle
安装 Phystrix Bundle 并覆盖状态存储配置
# services.yml services: PixelFederation\Phystrix\Storage\RedisStateStorage: arguments: - '@snc_redis.cache' phystrix.state_storage: alias: PixelFederation\Phystrix\Storage\RedisStateStorage