Class DependencyInjectionEventBus
- Namespace
- ReflectionEventing.DependencyInjection
- Assembly
- ReflectionEventing.DependencyInjection.dll
public class DependencyInjectionEventBus : EventBus, IEventBus
- Inheritance
-
DependencyInjectionEventBus
- Implements
- Inherited Members
- Extension Methods
Constructors
DependencyInjectionEventBus(QueueProcessorOptionsProvider, IConsumerProvider, IConsumerTypesProvider, IEventsQueue)
public DependencyInjectionEventBus(QueueProcessorOptionsProvider options, IConsumerProvider consumerProviders, IConsumerTypesProvider consumerTypesProvider, IEventsQueue queue)
Parameters
optionsQueueProcessorOptionsProviderconsumerProvidersIConsumerProviderconsumerTypesProviderIConsumerTypesProviderqueueIEventsQueue
Methods
PublishAsync<TEvent>(TEvent, CancellationToken)
Adds the specified event to the queue.Another scope will take over execution as configured.
public override Task PublishAsync<TEvent>(TEvent eventItem, CancellationToken cancellationToken = default) where TEvent : class
Parameters
eventItemTEventThe event to publish.
cancellationTokenCancellationTokenA cancellation token that can be used to cancel the operation.
Returns
- Task
A task that represents the asynchronous operation.
Type Parameters
TEventThe type of the event to publish.
Remarks
The method only adds the event to the execution queue, it does not wait for its successful execution.