Browse Source

Call PublishToEventBusAsync instead of PublishAsync.

pull/9909/head
maliming 5 years ago
parent
commit
cd364b4a6d
  1. 6
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs
  2. 3
      framework/src/Volo.Abp.Uow/Volo/Abp/Uow/IUnitOfWorkEventPublisher.cs

6
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs

@ -19,7 +19,7 @@ namespace Volo.Abp.EventBus
protected IServiceScopeFactory ServiceScopeFactory { get; }
protected ICurrentTenant CurrentTenant { get; }
protected IUnitOfWorkManager UnitOfWorkManager { get; }
protected IEventErrorHandler ErrorHandler { get; }
@ -108,7 +108,7 @@ namespace Volo.Abp.EventBus
);
return;
}
await PublishToEventBusAsync(eventType, eventData);
}
@ -154,7 +154,7 @@ namespace Volo.Abp.EventBus
var baseEventType = eventType.GetGenericTypeDefinition().MakeGenericType(baseArg);
var constructorArgs = ((IEventDataWithInheritableGenericArgument)eventData).GetConstructorArgs();
var baseEventData = Activator.CreateInstance(baseEventType, constructorArgs);
await PublishAsync(baseEventType, baseEventData);
await PublishToEventBusAsync(baseEventType, baseEventData);
}
}
}

3
framework/src/Volo.Abp.Uow/Volo/Abp/Uow/IUnitOfWorkEventPublisher.cs

@ -6,6 +6,7 @@ namespace Volo.Abp.Uow
public interface IUnitOfWorkEventPublisher
{
Task PublishLocalEventsAsync(IEnumerable<UnitOfWorkEventRecord> localEvents);
Task PublishDistributedEventsAsync(IEnumerable<UnitOfWorkEventRecord> distributedEvents);
}
}
}

Loading…
Cancel
Save