コード例 #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.CompletedTask);
 }