dhh1128 / intent

the intent formal language
https://intentlang.org
2 stars 1 forks source link

implement circuit breakers #43

Open dhh1128 opened 10 years ago

dhh1128 commented 10 years ago

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