danielfm / pybreaker

Python implementation of the Circuit Breaker pattern.
BSD 3-Clause "New" or "Revised" License
528 stars 73 forks source link

Abstract state storage, extract CircuitMemoryStorage. #12

Closed phillbaker closed 7 years ago

phillbaker commented 7 years ago

This PR abstracts state storage in preparation for adding a separate redis-backed storage to address https://github.com/danielfm/pybreaker/issues/10.

This PR is currently missing:

I wanted to break up the work and get initial feedback on this direction, if this looks directionally correct, I can finish up the remaining work. Thanks!

phillbaker commented 7 years ago

@danielfm added the missing documentation - would you prefer adding explicit tests for the MemoryAdapter? The behavior does look well covered by existing tests.

I pulled the code for the redis implementation out of this PR, I'd like to do that as a followup PR if that makes sense?

danielfm commented 7 years ago

@phillbaker

...would you prefer adding explicit tests for the MemoryAdapter? The behavior does look well covered by existing tests.

I agree, we don't need more tests if the ones we already have cover the new implementation just as well.

I pulled the code for the redis implementation out of this PR, I'd like to do that as a followup PR if that makes sense?

Yes, it does. 😄

phillbaker commented 7 years ago

Great - anything else I can do to get this PR merged?

danielfm commented 7 years ago

Thanks for your contribution, @phillbaker!