protected override async Task <bool> RunInnerAsync( HandleMessageContext context, Func <CancellationToken, Task <bool> > func, CancellationToken stoppingToken) { if (context == null) { throw new ArgumentNullException(nameof(context)); } return(await _func(context.MessageAs <TMessage>())); }
protected override async Task <bool> RunInnerAsync( HandleMessageContext context, Func <CancellationToken, Task <bool> > func, CancellationToken stoppingToken) { if (context == null) { throw new ArgumentNullException(nameof(context)); } stoppingToken.ThrowIfCancellationRequested(); var resolutionContext = new HandlerResolutionContext(context.QueueName); IHandlerAsync <T> handler = _handlerResolver(resolutionContext); return(await handler.Handle(context.MessageAs <T>()).ConfigureAwait(false)); }
protected override async Task <bool> RunInnerAsync(HandleMessageContext context, Func <CancellationToken, Task <bool> > func, CancellationToken stoppingToken) { await Handler.Handle(context.MessageAs <TMessage>()).ConfigureAwait(false); return(true); }