示例#1
0
        public async Task Handle(AddOneCommand command)
        {
            //_logger.Info($"processing [{command.MessageId}]");

            await Task.Delay(TimeSpan.FromMilliseconds(_delay));

            Store = Store + 1;

            //_logger.Info($"async await actor finished [{command.MessageId}]");
        }
示例#2
0
        public bool Handle(AddOneCommand command)
        {
            // _logger.Info($"processing [{command.MessageId}]");

            Task.Delay(TimeSpan.FromMilliseconds(_delay))
            .ContinueWith(continuation =>
            {
                var cmd = command;
                return(new PipeAddOneCommand(cmd.MessageId));
            }, TaskContinuationOptions.ExecuteSynchronously)
            .PipeTo(Self);

            return(true);
        }