Пример #1
0
        public Task Handle(MyMessage message, IMessageHandlerContext context)
        {
            var longRunning1 = Task.Run(() => ComputeBoundComponent.BlocksForALongTime());
            var longRunning2 = Task.Run(() => ComputeBoundComponent.BlocksForALongTime());

            return(Task.WhenAll(longRunning1, longRunning2));
        }
Пример #2
0
 public Task Handle(MyMessage message, IMessageHandlerContext context)
 {
     ComputeBoundComponent.BlocksForAShortTime();
     return(Task.FromResult(0));  // or Task.CompletedTask
 }