ExternalService.CircuitBreaker.Fuse (ExternalService v2.2.0)

Copy Markdown View Source

The default circuit breaker backend, built on the :fuse library.

This is the breaker ExternalService has always used, and you get it without configuring anything. It is node-local: each node counts its own failures and opens its own breaker, which is usually what you want — a node with a bad network path should stop calling the service without taking the rest of the cluster down with it.

It is configured through the ordinary :circuit_breaker options (:tolerate, :within, :reset, :fault_injection); see ExternalService.start/2.

Summary

Functions

Builds the :fuse strategy tuple for the given circuit breaker options.

Returns the number of failures the breaker tolerates before opening.

Functions

strategy(options)

@spec strategy(keyword()) :: tuple()

Builds the :fuse strategy tuple for the given circuit breaker options.

Exposed so that backends layered on top of this one (such as ExternalService.CircuitBreaker.Cluster) can reuse it.

tolerate(arg)

Returns the number of failures the breaker tolerates before opening.

Read back out of an installed breaker's config, so that a layered backend can work out how many melts it takes to trip this node's breaker.