application # logic that needs to take place due the transition. # # stoplight - The `Stoplight::Light` that holds the Circuit Breaker. # from - The current color of the stoplight. # to - The color the stoplight is transitioning to. # error - The exception that might have been raised inside the Circuit # Breaker. # # Returns nothing. def notify(_, from, to, error) if opened?(from, to) failed!(error) if error elsif closed?(from, to) succeeded! end end