Closed jeffrand closed 7 years ago
Totally forgot to mention this, but can you please update the README with usage instructions?
Will do! On Wed, Jun 21, 2017 at 5:38 PM Daniel Martins notifications@github.com wrote:
Totally forgot to mention this, but can you please update the README with usage instructions?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/danielfm/pybreaker/pull/18#issuecomment-310212722, or mute the thread https://github.com/notifications/unsubscribe-auth/ACckkW7mExmVQXIoHZ77dwnGRoWkeUkeks5sGY1HgaJpZM4N7umk .
--
- Jeff
I'm a big fan of your library and I've been using my own fork over here at SeatGeek, so I figured I'd contribute. We use Tornado as our webserver and use this code to circuit break asynchronous code.
This change adds optional support for Tornado coroutines. This should be a backwards compatible change.
I did this by:
CircuitBreaker.__call__
to optionally take a keyword argument__pybreaker_call_async
, which will callCircuitBreaker.call_async
ifTrue
. The keyword argument is sufficiently verbose to hopefully avoid collision with existing keyword argumentsCircuitBreaker.call_async
CircuitBreakerState.call_async
This also has tests that cover the parts that I added. It also fixes a bug if
redis
is not present.