Class EventPublisher<TEvent>
- Namespace
- AnyProtocol
- Assembly
- AnyProtocol.dll
Provides the event publisher implementation used by AnyProtocol applications.
public sealed class EventPublisher<TEvent> : IEventPublisher<TEvent> where TEvent : class
Type Parameters
TEventThe event type.
- Inheritance
-
EventPublisher<TEvent>
- Implements
-
IEventPublisher<TEvent>
- Inherited Members
Constructors
EventPublisher(ISendTransport, IMessageSerializer, string, string, OutboundOperationExecutor?, IMessageEnvelopeFactory?, LargePayloadOffloader?)
Performs the event publisher operation.
public EventPublisher(ISendTransport transport, IMessageSerializer serializer, string channel, string transportName = "unknown", OutboundOperationExecutor? executor = null, IMessageEnvelopeFactory? envelopeFactory = null, LargePayloadOffloader? payloadOffloader = null)
Parameters
transportISendTransportThe transport.
serializerIMessageSerializerThe serializer.
channelstringThe logical message channel.
transportNamestringThe transport name.
executorOutboundOperationExecutorThe outbound operation executor.
envelopeFactoryIMessageEnvelopeFactoryThe message metadata factory.
payloadOffloaderLargePayloadOffloaderThe optional outbound payload processor.
Methods
PublishAsync(TEvent, CancellationToken)
Publishes a message to all subscribers of its configured channel.
public ValueTask PublishAsync(TEvent @event, CancellationToken cancellationToken = default)
Parameters
eventTEventThe event.
cancellationTokenCancellationTokenThe token used to cancel the operation.
Returns
- ValueTask
A task that represents the asynchronous operation.