Created
August 11, 2020 03:04
-
-
Save ashkrit/98f6ba37287593ae0b9fb9949ed68efc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
machine("Circuit Breaker", machine -> { | |
machine.startWith("OPEN"); | |
machine.at("OPEN", rule -> { | |
rule.when("connect", failOp, "OPEN", "CLOSED"); | |
}); | |
machine.at("CLOSED", rule -> { | |
rule.when("connect", s -> { | |
}, "CLOSED"); | |
rule.when("re-connect", s -> { | |
}, "HALF-OPEN"); | |
}); | |
machine.at("HALF-OPEN", rule -> { | |
rule.when("connect", s -> { | |
}, "CLOSED"); | |
rule.when("re-open", s -> { | |
}, "OPEN"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment