{"id":19312121,"url":"https://github.com/bigcommerce/gruf-circuit-breaker","last_synced_at":"2025-04-22T15:31:55.410Z","repository":{"id":52419517,"uuid":"91472119","full_name":"bigcommerce/gruf-circuit-breaker","owner":"bigcommerce","description":"Circuit breaker support for gruf","archived":false,"fork":false,"pushed_at":"2021-04-29T19:39:23.000Z","size":28,"stargazers_count":9,"open_issues_count":2,"forks_count":1,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-10-07T12:40:00.954Z","etag":null,"topics":["circuit-breaker","grpc","gruf","stoplight"],"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/bigcommerce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-16T15:07:55.000Z","updated_at":"2024-05-25T23:42:45.000Z","dependencies_parsed_at":"2022-09-04T11:51:00.625Z","dependency_job_id":null,"html_url":"https://github.com/bigcommerce/gruf-circuit-breaker","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fgruf-circuit-breaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fgruf-circuit-breaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fgruf-circuit-breaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fgruf-circuit-breaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigcommerce","download_url":"https://codeload.github.com/bigcommerce/gruf-circuit-breaker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223900372,"owners_count":17222028,"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","grpc","gruf","stoplight"],"created_at":"2024-11-10T00:32:56.165Z","updated_at":"2024-11-10T00:32:56.335Z","avatar_url":"https://github.com/bigcommerce.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gruf-circuit-breaker - Circuit Breaker for gruf\n\n[![CircleCI](https://circleci.com/gh/bigcommerce/gruf-circuit-breaker/tree/main.svg?style=svg)](https://circleci.com/gh/bigcommerce/gruf-circuit-breaker/tree/main) [![Gem Version](https://badge.fury.io/rb/gruf-circuit-breaker.svg)](https://badge.fury.io/rb/gruf-circuit-breaker) [![Inline docs](http://inch-ci.org/github/bigcommerce/gruf-circuit-breaker.svg?branch=main)](http://inch-ci.org/github/bigcommerce/gruf-circuit-breaker) \n\nAdds circuit breaker support for [gruf](https://github.com/bigcommerce/gruf) 2.0.0 or later.\n\nThis uses the wonderful [stoplight](https://github.com/orgsync/stoplight) gem for handling\nthe internals of circuit breaking.\n\n## Installation\n\n```ruby\ngem 'gruf-circuit-breaker'\n```\n\nThen in an initializer or before use, after loading gruf:\n\n```ruby\nrequire 'gruf/circuit_breaker'\nGruf::Hooks::Registry.add(:circuit_breaker, Gruf::CircuitBreaker::Hook)\n```\n\n## Configuration\n\nYou can further customize the tracing of gruf services via the configuration:\n\n```ruby\nGruf.configure do |c|\n  c.interceptors.use(Gruf::CircuitBreaker::Interceptor, { \n    # set cool-off time in seconds (defaults to 60)\n    cool_off_time: 15, \n    # set threshold count to 2\n    threshold: 2, \n    # set the gRPC failure statuses that will cause a circuit to trip \n    failure_statuses: [GRPC::Internal, GRPC::Unknown, GRPC::Aborted],\n    # use a redis instance for the stoplight data storage\n    redis: Redis.new\n  })\nend\n```\n\n## License\n\nCopyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved \n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated \ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the \nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit \npersons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the \nSoftware.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE \nWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR \nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR \nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigcommerce%2Fgruf-circuit-breaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigcommerce%2Fgruf-circuit-breaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigcommerce%2Fgruf-circuit-breaker/lists"}