ksaveras / circuit-breaker-bundle
电路断路器 Symfony 扩展包
1.0.0
2023-06-24 17:24 UTC
Requires
- php: ^8.1
- ksaveras/circuit-breaker: ^2.0
- symfony/framework-bundle: ^5.0|^6.0|^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.6
- phpstan/phpstan-phpunit: ^1.0
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ^10.2
- rector/rector: ^0.17.0
README
安装
确保全局已安装 Composer,如 Composer 文档中的安装章节所述。
使用 Symfony Flex 的应用程序
打开命令控制台,进入您的项目目录并执行
$ composer require ksaveras/circuit-breaker-bundle
未使用 Symfony Flex 的应用程序
步骤 1:下载扩展包
打开命令控制台,进入您的项目目录并执行以下命令以下载此扩展包的最新稳定版本
$ composer require ksaveras/circuit-breaker-bundle
步骤 2:启用扩展包
然后,通过将其添加到项目 config/bundles.php
文件中注册的扩展包列表中来启用扩展包
// config/bundles.php return [ // ... Ksaveras\CircuitBreakerBundle\KsaverasCircuitBreakerBundle::class => ['all' => true], ];
配置
# config/packages/circuit_breaker.yaml ksaveras_circuit_breaker: circuit_breakers: cb_name: storage: 'cache' failure_threshold: 3 retry_policy: exponential: reset_timeout: 60 maximum_timeout: 86400 storage: in_memory: ~ cache: 'pool_service_id' my_storage: '@storage_service'