proxy.golang.org : github.com/sigmavirus24/circuitry
Package circuitry provides a framework for building distribuited Circuit Breakers. It's primarily designed to be able to synchronize state with a backend so that a distributed system can have one Circuit Breaker for any piece it cares to implement that for. For example, in a system calling any number of other systems, it can be beneficial to the health of the first system to implement a circuit breaker around calls to the other dependencies they have. If you have N dependencies on other systems, you could have N circuit breakers that would work across all of the instances of your system to protect it as a whole. If instead you had in memory only circuit breakers, each instance of that system would have to individually reach your failure threshold to trip the breaker before all instances have stopped talking to it. That could affect availability and performance for your users. Alternatively, you might have ot set the threshold artificially low and risk the breaker opening when it didn't need to. circuitry aims to provide an excellent distributed circuit breaker pattern as well as supportive libraries and a handful of curated backends. For example, circuitry provides interfaces for structured logging libraries as well as implementations for logrus and slog. Likewise, it allows for metrics to be gathered from it by providing interfaces for users to specify their sink. Finally, it has a backend interface and provides implementations in Redis and DynamoDB for production usage and for reference. The main way to interact with circuitry is to create a CircuitBreakerFactory. This looks like: Once you have a factory you can create any number of named CircuitBreakers. circuitry also allows you to include relevant context when creating a CircuitBreaker. For example, maybe you have tracing context you For additional information see also: - https://learn.microsoft.com/en-us/previous-versions/msp-n-p/dn589784(v=pandp.10)?redirectedfrom=MSDN - https://www.redhat.com/architect/circuit-breaker-architecture-pattern - https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/circuit-breaker.html
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/sigmavirus24/circuitry
License: Apache-2.0
Latest release: 6 months ago
First release: over 1 year ago
Namespace: github.com/sigmavirus24
Stars: 1 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: about 4 hours ago