wsargent/circuit_breaker là dự án mã nguồn mở trên GitHub, viết chủ yếu bằng Ruby, với 406 sao. Implementation of Michael Nygard's Circuit Breaker pattern in Ruby
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
CircuitBreaker is a relatively simple Ruby mixin that will wrap
a call to a given service in a circuit breaker pattern.
The circuit starts off "closed" meaning that all calls will go through.
However, consecutive failures are recorded and after a threshold is reached,
the circuit will "trip", setting the circuit into an "open" state.
In an "open" state, every call to the service will fail by raising
CircuitBrokenException.
The circuit will remain in an "open" state until the failure timeout has
elapsed.
After the failure_timeout has elapsed, the circuit will go into
a "half open" state and the call will go through. A failure will
immediately pop the circuit open again, and a success will close the
circuit and reset the failure count.
For services that can take an unmanagable amount of time to respond an
invocation timeout threshold is provided. If the service fails to return
before the invocation_timeout duration has passed, the circuit will "trip",
setting the circuit into an "open" state.
require 'circuit_breaker'
class TestService
include CircuitBreaker
def call_remote_service() ...
circuit_method :call_remote_service
# Optional
circuit_handler do |handler|
handler.logger = Logger.new(STDOUT)
handler.failure_threshold = 5
handler.failure_timeout = 5
handler.invocation_timeout = 10
handler.excluded_exceptions = [NotConsideredFailureException]
end
# Optional
circuit_handler_class MyCustomCircuitHandler
end
FEATURES/PROBLEMS:
Can run out of the box with minimal dependencies and a couple of lines of code.
Easy to extend: add your own circuit breakers or states or extend the existing ones.
Does not currently handle static class methods.
SYNOPSIS:
An implementation of Michael Nygard's Circuit Breaker pattern.
REQUIREMENTS:
circuit_breaker has a dependency on AASM @ http://github.com/rubyist/aasm/tree/master
INSTALL:
gem install circuit_breaker
LICENSE:
Copyright (c) 2016, Will Sargent
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the distribution.
The names of its contributors may not be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/wsargent/circuit_breaker là nguồn chính thức.
wsargent/circuit_breaker có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho wsargent/circuit_breaker. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
wsargent/circuit_breaker có trang demo không?
Dự án có trang chủ ở http://rdoc.info/projects/wsargent/circuit_breaker. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
wsargent/circuit_breaker là gì?
wsargent/circuit_breaker (wsargent/circuit_breaker) là dự án Ruby trên GitHub. Theo mô tả gốc: Implementation of Michael Nygard's Circuit Breaker pattern in Ruby
Đọc đầy đủ README ở tab phía trên.
Chưa chắc circuit_breaker có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về circuit_breaker.