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
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