Table of Contents

Interface INotificationPublisher

Namespace
Caesar
Assembly
Caesar.Abstractions.dll

Strategy that decides how the handlers of a notification are invoked (sequentially, in parallel, ...).

public interface INotificationPublisher

Remarks

The executors hold handler instances resolved from the publishing caller's scope, and the token is the caller's. Run them before the returned task completes: a publisher that returns first and runs them later, for example on a background thread or through a channel, may run handlers whose scoped dependencies were already disposed. For background processing, queue the notification itself and publish it from a scope of the consumer's own.

Methods

Publish(IEnumerable<NotificationHandlerExecutor>, INotification, CancellationToken)

Invokes the handler executors for notification.

Task Publish(IEnumerable<NotificationHandlerExecutor> handlerExecutors, INotification notification, CancellationToken cancellationToken)

Parameters

handlerExecutors IEnumerable<NotificationHandlerExecutor>

One executor per resolved handler: those for the notification's runtime type, in registration order, then those registered for its base classes and interfaces.

notification INotification

The notification being published.

cancellationToken CancellationToken

Cancellation token.

Returns

Task