The circuitbreaker middleware prevents fn invocations in the face of errors.
The following table describes the keys on the configuration object for the circuitbreaker middleware.
|String||The name of the circuit breaker|
|Integer||The max number of requests to allow through when the circuit breaker is half-open|
|Duration||The period at which the internal counts are cleared|
|Duration||The duration of the open state before moving into the half-open state|
The following applies a circuit breaker to prevent calling the remote endpoint if it has had several failures in a small window of time.
source: fnrun.source/http middleware: - fnrun.middleware/circuitbreaker: name: myBreaker fn: fnrun.fn/http: targetURL: http://example.com/some-endpoint