Created
June 24, 2017 13:45
-
-
Save tomliversidge/c35ee9bad5eeec03b1af270b9f5d23b5 to your computer and use it in GitHub Desktop.
Saga 3.4
This file contains hidden or 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
| private void ApplyEvent(Event @event) | |
| { | |
| switch (@event.Data) | |
| { | |
| case TransferStarted msg: | |
| _behavior.Become(AwaitingDebitConfirmation); | |
| break; | |
| case AccountDebited msg: | |
| _behavior.Become(AwaitingCreditConfirmation); | |
| break; | |
| case CreditRefused msg: | |
| _behavior.Become(RollingBackDebit); | |
| break; | |
| case AccountCredited _: | |
| case DebitRolledBack _: | |
| case TransferFailed _: | |
| _processCompleted = true; | |
| break; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment