{"id":15145706,"url":"https://github.com/soundcloud/simple_circuit_breaker","last_synced_at":"2025-10-19T16:32:16.482Z","repository":{"id":5378557,"uuid":"6565982","full_name":"soundcloud/simple_circuit_breaker","owner":"soundcloud","description":"Simple Ruby implementation of the Circuit Breaker design pattern","archived":false,"fork":false,"pushed_at":"2024-02-01T19:00:34.000Z","size":13,"stargazers_count":29,"open_issues_count":1,"forks_count":10,"subscribers_count":181,"default_branch":"master","last_synced_at":"2025-01-29T21:23:44.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soundcloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-11-06T17:18:03.000Z","updated_at":"2024-02-01T19:00:38.000Z","dependencies_parsed_at":"2024-02-01T19:10:39.369Z","dependency_job_id":"2c147ab7-7ca5-46dd-9f23-df9c5f435190","html_url":"https://github.com/soundcloud/simple_circuit_breaker","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soundcloud%2Fsimple_circuit_breaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soundcloud%2Fsimple_circuit_breaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soundcloud%2Fsimple_circuit_breaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soundcloud%2Fsimple_circuit_breaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soundcloud","download_url":"https://codeload.github.com/soundcloud/simple_circuit_breaker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237172115,"owners_count":19266614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-26T11:41:55.142Z","updated_at":"2025-10-19T16:32:11.180Z","avatar_url":"https://github.com/soundcloud.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleCircuitBreaker\n\n## Overview\n\nSimple Ruby implementation of the [Circuit Breaker design pattern][0].\n\nThis implementation aims to be as simple as possible. It does not have external\ndependencies and only handles the core circuit breaker functionality. Wrapping\nbackend calls in timeouts and other exception handling is left to the user of\nthe library.\n\n## Usage\n\n```ruby\nfailure_threshold = 3 # Trip the circuit after 3 consecutive failures.\nretry_timeout = 10    # Retry on an open circuit after 10 seconds.\ncircuit_breaker = SimpleCircuitBreaker.new(failure_threshold, retry_timeout)\n\n# By default, all exceptions will trip the circuit.\ncircuit_breaker.handle do\n  FooClient.new.request\nend\n\n# Setting explicit exceptions that trip the circuit:\ncircuit_breaker.handle FooError, BarError do\n  FooClient.new.request\nend\n```\n\n`SimpleCircuitBreaker#handle` raises a `SimpleCircuitBreaker::CircuitOpenError`\nwhen the circuit is open. Otherwise, it re-raises any exceptions that occur in\nthe block.\n\n## Installation\n\n```bash\ngem install simple_circuit_breaker\n```\n\n## Testing\n\n[![Build Status](https://secure.travis-ci.org/soundcloud/simple_circuit_breaker.png)][1]\n\nRun the tests with\n\n```bash\nrake\n```\n\n## Authors\n\nJulius Volz (julius@soundcloud.com), Tobias Schmidt (ts@soundcloud.com).\n\n## Alternatives\n\n  * [Circuit Breaker][2]: heavily customizable circuit handler\n  * [CircuitB][3]: supports keeping global circuit state in memcached\n\n## Contributing\n\nPull requests welcome!\n\n[0]: http://en.wikipedia.org/wiki/Circuit_breaker_design_pattern\n[1]: http://travis-ci.org/soundcloud/simple_circuit_breaker\n[2]: https://github.com/wsargent/circuit_breaker\n[3]: https://github.com/alg/circuit_b\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoundcloud%2Fsimple_circuit_breaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoundcloud%2Fsimple_circuit_breaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoundcloud%2Fsimple_circuit_breaker/lists"}