Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System.Threading.Tasks;
using Orleans;
namespace Grains
{
public interface ICounterGrain : IGrainWithStringKey
{
Task Increment(int increment);
Task<int> GetCount();
}
public class Counter : Grain, ICounterGrain
{
private int _counter;
public Task Increment(int increment)
{
_counter += increment;
return Task.CompletedTask;
}
public Task<int> GetCount()
{
return Task.FromResult(_counter);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.