asynkron / protoactor-dotnet

Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin
http://proto.actor
Apache License 2.0
1.73k stars 288 forks source link

Use named tuple in IProviderState.GetSnapshotAsync method return type #116

Closed tomliversidge closed 7 years ago

tomliversidge commented 7 years ago

Currently the GetSnapshotAsync returns a Task<Tuple<object, long>> but it would be nicer to use the new named tuple support in C#7 - this will avoid the ugly Item1 and Item2 syntax.

For example, could have Task<(object state, long index)> GetSnapshotAsync

and call it like var (state, index) = await providerState.GetSnapshotAsync()

or

var result = await providerState.GetSnapshotAsync() _state = result.state

Might be better to do this soon if wanted before more persistence plugins are developed.

raskolnikoov commented 7 years ago

Yes this I like :)

cpx86 commented 7 years ago

Absolutely yes :)

raskolnikoov commented 7 years ago

Close this now that we have PR https://github.com/AsynkronIT/protoactor-dotnet/pull/117 implementing this?

tomliversidge commented 7 years ago

You should be able to reference the issue in the commit message to close it automatically when it is merged: https://help.github.com/articles/closing-issues-via-commit-messages/

TLDR: just add Fixes #116 to the commit :)