{"id":20355445,"url":"https://github.com/dcoxall/eventmachine-circuit_breaker","last_synced_at":"2025-04-12T02:50:50.017Z","repository":{"id":56844988,"uuid":"108462952","full_name":"dcoxall/eventmachine-circuit_breaker","owner":"dcoxall","description":"A circuit breaker for eventmachine and em-http-request","archived":false,"fork":false,"pushed_at":"2018-03-20T15:16:13.000Z","size":12,"stargazers_count":1,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-25T04:22:26.743Z","etag":null,"topics":["circuit-breaker","eventmachine","http","middleware"],"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/dcoxall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-26T20:36:53.000Z","updated_at":"2018-03-28T21:16:52.000Z","dependencies_parsed_at":"2022-09-17T11:02:16.761Z","dependency_job_id":null,"html_url":"https://github.com/dcoxall/eventmachine-circuit_breaker","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcoxall%2Feventmachine-circuit_breaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcoxall%2Feventmachine-circuit_breaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcoxall%2Feventmachine-circuit_breaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcoxall%2Feventmachine-circuit_breaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcoxall","download_url":"https://codeload.github.com/dcoxall/eventmachine-circuit_breaker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248509192,"owners_count":21115960,"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":["circuit-breaker","eventmachine","http","middleware"],"created_at":"2024-11-14T23:12:45.146Z","updated_at":"2025-04-12T02:50:49.981Z","avatar_url":"https://github.com/dcoxall.png","language":"Ruby","readme":"# EventMachine::CircuitBreaker\n\n[![Build Status](https://travis-ci.org/dcoxall/eventmachine-circuit_breaker.svg?branch=master)](https://travis-ci.org/dcoxall/eventmachine-circuit_breaker)\n\n**This project is still in active development**\n\nThis library is meant to provide a simple way to enable the circuit breaker pattern to em-http requests by providing some middleware that can prevent requests and manage circuit state based on response parameters.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'eventmachine-circuit_breaker'\n```\n\nAnd then execute:\n\n    $ bundle\n\n\n## Usage\n\n```ruby\nrequire 'eventmachine/circuit_breaker'\nrequire 'em-http-request'\n\n# circuit breaker for all requests\nEventMachine.run do\n  EventMachine::HttpRequest.use EventMachine::CircuitBreaker\n  # now you can use em-http-request as normal\nend\n\n# circuit breaker per connection\nEventMachine.run do\n  connection = EventMachine::HttpRequest.new(\"http://example.com\")\n  connection.use EventMachine::CircuitBreaker\n  connection.get\n  # ...\nend\n\n# sharing circuit state\nEventMachine.run do\n  circuit_strategy = EventMachine::CircuitBreaker::Strategy::Basic.new\n\n  connection_1 = EventMachine::HttpRequest.new(\"http://example.com/foo\")\n  connection_1.use EventMachine::CircuitBreaker, strategy: circuit_strategy\n  connection_1.get\n  # ...\n\n  connection_2 = EventMachine::HttpRequest.new(\"http://example.com/bar\")\n  connection_2.use EventMachine::CircuitBreaker, strategy: circuit_strategy\n  connection_2.get\n  # ...\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/dcoxall/eventmachine-circuit_breaker.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcoxall%2Feventmachine-circuit_breaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcoxall%2Feventmachine-circuit_breaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcoxall%2Feventmachine-circuit_breaker/lists"}