{"library":"pyramid-retry","title":"pyramid_retry","description":"An execution policy for the Pyramid web framework that supports retrying requests after certain failure exceptions. Version 2.1.1 provides integration with Pyramid's tweens to automatically retry failed requests based on configurable policies. It is maintained by the Pylons project and has a stable release cadence.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pyramid-retry"],"cli":null},"imports":["from pyramid_retry import RetryablePolicy","from pyramid_retry import retry_tween_factory"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from wsgiref.simple_server import make_server\nfrom pyramid.config import Configurator\nfrom pyramid_retry import RetryablePolicy, retry_tween_factory\n\ndef hello_world(request):\n    return {'status': 'ok'}\n\nif __name__ == '__main__':\n    with Configurator() as config:\n        config.add_route('home', '/')\n        config.add_view(hello_world, route_name='home', renderer='json')\n        # Set retry policy\n        config.add_tween('pyramid_retry.retry_tween_factory')\n        config.add_settings({\n            'retry.max_attempts': 3,\n            'retry.policies': [RetryablePolicy()],\n        })\n        app = config.make_wsgi_app()\n    server = make_server('0.0.0.0', 8080, app)\n    server.serve_forever()","lang":"python","description":"Minimal example configures retries with default policy.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}