Example #1
0
        private async Task DispatchToSubscriberAsync(
            object handler,
            SubscriberInfomation subscriberInfomation,
            IDomainEvent domainEvent,
            CancellationToken cancellationToken)
        {
            _log.Verbose(() => string.Format(
                             "Calling HandleAsync on handler '{0}' for aggregate event '{1}'",
                             handler.GetType().PrettyPrint(),
                             domainEvent.EventType.PrettyPrint()));

            await subscriberInfomation.HandleMethod(handler, domainEvent, cancellationToken).ConfigureAwait(false);
        }
Example #2
0
 private async Task DispatchToSubscriberAsync(object handler, SubscriberInfomation subscriberInfomation, IDomainEvent domainEvent)
 {
     try
     {
         _log.Verbose(
             "Calling HandleAsync on handler '{0}' for aggregate event '{1}'",
             handler.GetType().Name,
             domainEvent.EventType.Name);
         await subscriberInfomation.HandleMethod(handler, domainEvent).ConfigureAwait(false);
     }
     catch (Exception exception)
     {
         _log.Error(
             exception,
             "Failed to dispatch to event handler {0}",
             handler.GetType().Name);
     }
 }
 private async Task DispatchToSubscriberAsync(object handler, SubscriberInfomation subscriberInfomation, IDomainEvent domainEvent, CancellationToken cancellationToken)
 {
     try
     {
         _log.Verbose(() => string.Format(
             "Calling HandleAsync on handler '{0}' for aggregate event '{1}'",
             handler.GetType().PrettyPrint(),
             domainEvent.EventType.PrettyPrint()));
         await subscriberInfomation.HandleMethod(handler, domainEvent, cancellationToken).ConfigureAwait(false);
     }
     catch (Exception exception)
     {
         _log.Error(
             exception,
             "Failed to dispatch to event handler {0}",
             handler.GetType().PrettyPrint());
     }
 }