Download the PHP package rasuvaeff/resilience without Composer

On this page you can find all versions of the php package rasuvaeff/resilience. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package resilience

rasuvaeff/resilience

Latest Stable Version Total Downloads Build Static analysis Psalm Level

Resilience pipeline for PHP: composes rasuvaeff/retry, rasuvaeff/circuit-breaker, and rasuvaeff/bulkhead in the correct order with the exception glue built in — the PHP analogue of Polly's ResiliencePipeline / resilience4j's Decorators.

Русская версия

Using an AI coding assistant? Point it at llms.txt — a compact, self-contained API reference.

Why

The three leaf packages compose with plain closures — but composing them correctly requires glue that is easy to get wrong:

Rule Why
Retry must stop on CircuitOpenException the circuit is open; more attempts are pointless and hostile to the downstream
Retry must stop on BulkheadFullException (by default) saturation is not a transient error; blind re-attempts amplify overload
Retry must stop on the breaker's StorageFailure an infrastructure outage is not a downstream verdict
Bulkhead innermost a slot is held only while the callback runs — never during retry sleeps
Breaker outside the bulkhead an open circuit rejects before a slot is even requested
Breaker inside vs outside retry two legitimate orders with different semantics — see below

Pipeline fixes the nesting order and appends the glue automatically, without modifying the objects you pass in.

Requirements

Installation

Usage

The block below is executable — composer build runs it against the real API via rasuvaeff/doc-exec, so the // => values cannot rot. It uses the in-memory backends; in production you point the bulkhead and the breaker at Redis/APCu stores — the pipeline code does not change.

Every layer is optional, in any combination; an empty pipeline is a plain call (convenient for conditional assembly).

Nesting order

The default is retry(circuitBreaker(bulkhead(callback))):

Breaker inside vs outside retry

BreakerInsideRetry (default) ->breakerOutsideRetry()
One breaker outcome per attempt logical operation (whole retry loop)
Open circuit mid-loop cuts the remaining attempts instantly cannot cut the loop short
Transient blip fixed by a retry still counts toward the failure ratio never reaches the failure ratio
Choose when the breaker should see real per-call health the breaker should judge operations, not attempts
isFailure receives the callback's own exception (and, breaker-wrapping-bulkhead, BulkheadFullException) what the retry loop throws — RetryExhausted on exhaustion (last downstream exception in its lastException), never the callback's exception directly

Exception glue

build() appends stopIf predicates to a copy of your retry builder (Retry is immutable — the instance you pass is never modified, and your own stopIf/retryIf rules are preserved):

All terminal exceptions surface unchanged — RetryExhausted, CircuitOpenException, BulkheadFullException, StorageFailure, or the callback's own exception. The optional fallback receives whichever of them ended the call.

Public API

Type Description
Pipeline Builder: for(name), bulkhead(), retry(), circuitBreaker(), breakerOutsideRetry(), retryOnBulkheadFull(), build()
CompiledPipeline Immutable result: call(callable, ?callable $fallback): mixed, name()
PipelineOrder Enum: BreakerInsideRetry, BreakerOutsideRetry

Security

Examples

See examples/ — runnable scripts using the in-memory backends of the leaf packages (no server needed).

Development

License

BSD-3-Clause. See LICENSE.md.


All versions of resilience with dependencies

PHP Build Version
Package Version
Requires php Version 8.3 - 8.5
rasuvaeff/bulkhead Version ^1.1.3
rasuvaeff/circuit-breaker Version ^1.2
rasuvaeff/duration Version ^1.1
rasuvaeff/retry Version ^1.2.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rasuvaeff/resilience contains the following files

Loading the files please wait ...