DotNetWorkQueue.Queue.ProcessMessageAsync.Handle C# (CSharp) Method

Handle() public method

Handles processing the specified message with the context
public Handle ( IMessageContext context, IReceivedMessageInternal transportMessage ) : Task
context IMessageContext The context.
transportMessage IReceivedMessageInternal The transport message.
return Task
        public async Task Handle(IMessageContext context, IReceivedMessageInternal transportMessage)
        {
            using (var heartBeat = _heartBeatWorkerFactory.Create(context))
            {
                try
                {
                    await _methodToRun.HandleAsync(transportMessage, context.WorkerNotification).ConfigureAwait(false);
                    _commitMessage.Commit(context);
                }
                // ReSharper disable once UncatchableException
                catch (ThreadAbortException)
                {
                    heartBeat.Stop();
                    throw;
                }
                catch (OperationCanceledException)
                {
                    heartBeat.Stop();
                    throw;
                }
                catch (Exception exception)
                {
                    heartBeat.Stop();
                    _messageExceptionHandler.Handle(transportMessage, context, exception.InnerException ?? exception);
                }
            }
        }
    }