Created
June 24, 2017 13:11
-
-
Save tomliversidge/c3bb87126c3d079afa3e45babe4a4de6 to your computer and use it in GitHub Desktop.
Saga 2.1
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
| public Task ReceiveAsync(IContext context) | |
| { | |
| switch (context.Message) | |
| { | |
| // ... | |
| case Credit msg: | |
| return AdjustBalance(msg.ReplyTo, msg.Amount); | |
| case Debit msg when msg.Amount + _balance >= 0: | |
| return AdjustBalance(msg.ReplyTo, msg.Amount); | |
| // ... | |
| } | |
| return Actor.Done; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment