Skip to content

Implementation of netflix hystrix as a python module

Notifications You must be signed in to change notification settings

nattri07/circuitbreaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Circuit Breaker

Scope

To implement a circuit breaker that trips the circuit when the drop rate in a service is higher than a defined parameter. Also implements the immediate restore logic when recovering from a tripped state.

Setup

pip install -r /path/to/requirements.txt

Usage

  1. Download the cb module
  2. Run a redis server instance redis-server
  3. Import the circuitBreaker module into your code
from cb.circuitbreaker import circuitBreaker
  1. Create a circuitBreaker object
cb = circuitBreaker()
  1. Instead of standard http requests, use cb.getReq or cb.postReq
  2. Takes care drops and runs restore when needed. Change configs in cb/config.py to customize

Technologies Used

  • Python
  • Flask
  • SQLAlchemy
  • redis
  • boto SQS
  • Celery

About

Implementation of netflix hystrix as a python module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published