Skip to content

Instantly share code, notes, and snippets.

@tomliversidge
Last active April 1, 2017 19:17
Show Gist options
  • Save tomliversidge/3c96eea196d64ec94b510f6d108504e4 to your computer and use it in GitHub Desktop.
Save tomliversidge/3c96eea196d64ec94b510f6d108504e4 to your computer and use it in GitHub Desktop.
no wrapping at all
public async Task InitAsync(IProvider provider, IContext context)
{
// other bits removed for brevity
await State.GetEventsAsync(Name, Index, callbackData =>
{
// dont wrap callbackData in anything (callbackData could be renamed to @event?)
Context.ReceiveAsync(callbackData).Wait();
Index++;
});
await Context.ReceiveAsync(new RecoveryCompleted());
}
public async Task PersistEventAsync(object data)
{
var index = Index;
await State.PersistEventAsync(Name, index, data);
Index++;
// dont wrap data in anything (data could be renamed to @event?)
await Context.ReceiveAsync(data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment