Table of Contents

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

TEvent

The event type.

Inheritance
EventPublisher<TEvent>
Implements
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

transport ISendTransport

The transport.

serializer IMessageSerializer

The serializer.

channel string

The logical message channel.

transportName string

The transport name.

executor OutboundOperationExecutor

The outbound operation executor.

envelopeFactory IMessageEnvelopeFactory

The message metadata factory.

payloadOffloader LargePayloadOffloader

The 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

event TEvent

The event.

cancellationToken CancellationToken

The token used to cancel the operation.

Returns

ValueTask

A task that represents the asynchronous operation.