Skip to content

3rd state needed #13

@DrClick

Description

@DrClick

Currently, there are only 2 actual states

  1. closed -> flowing, operations are executed and until n Failures occur, these operations are attempted to be executed
  2. open -> broken, operations are returned immediately without being executed until the retryTime elapses

But there is a third state: waiting -> the time after a the retryTime elapses and the next operation is executed. If it is successful, the state is changed to closed, otherwise the state changes to broken

Currently there is no way for external listeners to listen for this state change
I propose the following:

    * Called when a the circuit breaker is attempting to reset (i.e. open -> waiting)
    *
    * @param name - name of the circuit breaker
    */
  def onAttemptReset(name: String): Unit = { /* blank default implementation */ }

but to be consistent, an actual waiting state should be built as this state is currently mangled with broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions