Created
April 21, 2017 06:49
-
-
Save tomliversidge/c4593b8e59890bf08c173bcd51e76b04 to your computer and use it in GitHub Desktop.
Example strategy usage
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 async Task PersistEventAsync(object @event) | |
| { | |
| Index++; | |
| await _state.PersistEventAsync(ActorId, Index, @event); | |
| _actor.UpdateState(new PersistedEvent(@event, Index)); | |
| if (_snapshotStrategy.ShouldTakeSnapshot(Index)) | |
| { | |
| await PersistSnapshotAsync(_actor.GetState()); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment