Hey HN!<p>I'm excited to share a project I've been working on: Django Protego, a dynamic and configurable Circuit Breaker for Django applications.<p>What is Django Protego?<p>Django Protego is a library that helps to protect your services from cascading failures by providing a Circuit Breaker mechanism. It's simple to integrate, dynamic, and works seamlessly with Django-based applications.<p>Key Features:<p>- Dynamic Configuration: Configure failure thresholds, reset timeouts, and half-open retries at runtime.<p>- Global Registry: The circuit breaker state is shared across views via a global registry, ensuring centralized control of your application’s fault tolerance.<p>- Easy to Use: Just decorate your views with @protego.protect to wrap your views in the circuit breaker logic.<p>- Flexible: Supports multiple circuit breakers in the same project, all configurable independently.<p>- In-Memory: Implements a highly efficient in-memory circuit breaker with no external dependencies.<p>How It Works:<p>- Protego Client: For each service, the circuit breaker maintains its state (open, closed, half-open) and tracks failures.<p>- Thresholds and Timeout: You can dynamically adjust failure thresholds, reset timeouts, and half-open retries via a central configuration in your Django app.<p>- Global Access: Protego ensures that circuit breakers are initialized once and are accessible globally in your project.<p>- Graceful Failures: When the circuit breaker is "open", instead of hitting the service, it automatically returns a failure response (e.g., 503 Service Unavailable).<p>Future Roadmap for Protego Circuit Breaker<p>To further enhance Protego and make it even more powerful and scalable, here's a roadmap that focuses on integrating it with Django, Redis, and databases for advanced fault tolerance, persistence, and distributed systems.<p>Link: <a href="https://github.com/grandimam/django-protego">https://github.com/grandimam/django-protego</a>