skyscanner / pyfailsafe Goto Github PK
View Code? Open in Web Editor NEWSimple failure handling. Failsafe implementation in Python
License: Other
Simple failure handling. Failsafe implementation in Python
License: Other
Something similar to what original Failsafe supports:
It can add a fixed delay between retries:
retryPolicy.withDelay(1, TimeUnit.SECONDS);
Or a delay that backs off exponentially:
retryPolicy.withBackoff(1, 30, TimeUnit.SECONDS);
It would be beneficial to for example log metrics when certain things happen... such as circuit breaker opening, using fallbacks, etc.
Possible implementation: https://github.com/danielfm/pybreaker#event-listening
We should just copy there the example calling github API from examples/ folder.
We need to show an example of setting retry_policy_factory
and the circuit_breaker_factory
, also stress out as much as possible that there needs to be just ONE instance of FallbackFailsafe per dependency.
Mention need to update version and CHANGELOG.md
Documenting the library with docstrings would help other developers to get started to contribute.
Our Travis build is configured to run in Python 3.5 and 'nightly' Python: https://github.com/Skyscanner/pyfailsafe/blob/master/.travis.yml#L4
The problem is that it tries to deploy to pypi from both of these environments. The first one succeeds, but second one always fails: https://travis-ci.org/Skyscanner/pyfailsafe/jobs/408569147
(most likely because the package is already published).
The desired behaviour is that tests should be run in all environments (3.5, 3.6, 3.7, nightly) and after all these tests succeed, the deployment should be run once.
The readme says I can use it with "classic" functions. Does it mean classic coroutines or sync functions? And I saw a recent commit that seemed that you were removing support for sync calls. Do you plan to bring the support to sync functions back?
Since I use aiozmq I'm stuck on yield from
and @asyncio.coroutine
can pyfailsafe work be used with this style of async programming ?
It seems the run()
method doesn't take parameters and in order to make it work, we need to pass a wrapped function with the parameters already bound (similar to using functools.partial
), as done in
pyfailsafe/examples/simple_failsafe.py
Line 38 in 179df4c
If this can be done internally by the method, the interface would be nicer.
I'm happy to contribute if you think this is a valid use case.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.