declare static circuit breaker object (may need to support both threadsafe and non-threadsafe versions, or a locking policy object that varies by threaded vs. unthreaded)
allow to set criteria for trip (cumulative number of failures, or % failures; what about cumulative timeout?)
as different codepaths get executed, call CB to tell it we're on the success path or a path where re-detect is needed
get to moment where CB must decide
3 states: open, closed, half-open (time to re-detect)
if open, go down alternate/protective path
if closed, go down normal path; on failure, opportunity to throw circuit breaker
if half-open, re-detect; if open, send signal to central dispatch; on success, close breaker and reset counters; on failure, open breaker and send signal to central dispatch and remember time/count when opened
declare static circuit breaker object (may need to support both threadsafe and non-threadsafe versions, or a locking policy object that varies by threaded vs. unthreaded) allow to set criteria for trip (cumulative number of failures, or % failures; what about cumulative timeout?)
as different codepaths get executed, call CB to tell it we're on the success path or a path where re-detect is needed get to moment where CB must decide 3 states: open, closed, half-open (time to re-detect) if open, go down alternate/protective path if closed, go down normal path; on failure, opportunity to throw circuit breaker if half-open, re-detect; if open, send signal to central dispatch; on success, close breaker and reset counters; on failure, open breaker and send signal to central dispatch and remember time/count when opened