Пример #1
0
        async Task <OperationResult> Process(TestStateful msg, IOperationContext arg2)
        {
            using (var trans = _stateManager.CreateTransaction())
            {
                _state = await _stateManager.GetOrAddAsync <IReliableDictionary <string, DateTime> >(ActorRef.Key.Id);

                await _state.AddOrUpdateAsync(trans, ActorRef.Key.Id, (x) => DateTime.UtcNow, (x, _) => DateTime.UtcNow);

                await trans.CommitAsync();
            }

            return(OperationResult.Success);
        }
Пример #2
0
        async public Task <OperationResult> TestStateful(TestStateful msg)
        {
            await StateManager.AddOrUpdateStateAsync("count", 1, (key, value) => value + 1);

            return(OperationResult.Success);
        }
Пример #3
0
 async public Task <OperationResult> TestStateful(TestStateful msg)
 {
     throw new NotImplementedException();
 }
 async Task <OperationResult> OnTestStateful(TestStateful msg, IOperationContext context)
 {
     using (BackendCallsTimer.NewContext())
         return(await _actor.TestStateful(msg));
 }
Пример #5
0
 async Task <OperationResult> Process(TestStateful msg, IOperationContext context)
 {
     using (BackendCallsTimer.NewContext())
         return(await _actor.SendAsync <OperationResult>(msg, context));
 }