public async Task HandleAsync(Event @event) { _context.KeepAlive(); await _handler.HandleAsync(_context, _serializer.Deserialize(@event)); _context.KeepAlive(); }
public async Task HandleAsync(NotificationContext context, TEvent @event) { if (_handler != null) { await _handler.HandleAsync(context, @event); } await context.CompleteAsync(); }
/// <inheritdoc/> public Task HandleAsync(TNotification notification, CancellationToken cancellation = default) { _handleProxySubject.OnNext(value: ct => _nextHandler.HandleAsync(notification, ct)); return(Task.CompletedTask); }
/// <inheritdoc/> public Task HandleAsync(TNotification notification, CancellationToken cancellation = default) => _handleProxyChannelWriter .WriteAsync(item: ct => _nextHandler.HandleAsync(notification, ct), cancellation) .AsTask();
/// <inheritdoc/> public Task HandleAsync(TNotification notification, CancellationToken cancellation = default) { return(_handleProxyBlock.SendAsync(ct => _nextHandler.HandleAsync(notification, ct), cancellation)); }
/// <inheritdoc/> public Task HandleAsync(TNotification notification, CancellationToken cancellation = default) => _backgroundHandleProxyQueue .EnqueueAsync(handleProxy: ct => _nextHandler.HandleAsync(notification, ct), cancellation) .AsTask();
public async Task NotifyAsync(INotification notification) { await _notificationHandler.HandleAsync(notification); }