Last active
April 1, 2017 19:17
-
-
Save tomliversidge/7676f08df6fdadf9fedd5e466d9b22d1 to your computer and use it in GitHub Desktop.
example actor
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
public async Task ReceiveAsync(IContext context) | |
{ | |
switch (context.Message) | |
{ | |
//...other handlers removed for brevity | |
case Multiply msg: | |
await Persistence.PersistEventAsync(new Multiplied { Amount = msg.Amount }); | |
break; | |
case Multiplied msg: | |
_state.Value = _state.Value * msg.Amount; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment