Table of Contents

Namespace Caesar

Classes

Mediator

Default IMediator implementation. Resolves handlers and behaviors from an IServiceProvider at call time, so it can be registered with any lifetime. Handler wrappers are stateless and cached per request type for the lifetime of the process.

NotificationHandlerExecutor

A resolved notification handler together with a callback that invokes it.

NotificationHandler<TNotification>

Convenience base class for synchronous notification handlers.

Structs

Unit

Represents a void return type. Used as the response of IRequest.

Interfaces

IBaseRequest

Marker interface shared by every request that is dispatched through ISender. Do not implement this directly; use IRequest, IRequest<TResponse> or IStreamRequest<TResponse>.

IMediator

Combines ISender and IPublisher. Prefer injecting the narrower interface when a component only sends or only publishes.

INotification

A notification (event) that is published to zero or more INotificationHandler<TNotification> instances.

INotificationHandler<TNotification>

Handles a notification. Multiple handlers may exist for the same notification type.

INotificationPublisher

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

IPipelineBehavior<TRequest, TResponse>

Wraps the handling of a request. Behaviors are executed in registration order and form a Russian-doll chain around the IRequestHandler<TRequest, TResponse>. Register an open-generic behavior to apply it to every request.

IPublisher

Publishes notifications to every registered handler.

IRequest

A request without a meaningful response (a command). Its response type is Unit. Handle it with IRequestHandler<TRequest>.

IRequestHandler<TRequest>

Handles a request that has no response (a command).

IRequestHandler<TRequest, TResponse>

Handles a request that returns a response.

IRequest<TResponse>

A request that produces a response of type TResponse. Exactly one IRequestHandler<TRequest, TResponse> handles it.

ISender

Sends requests to their single handler and creates response streams.

IStreamPipelineBehavior<TRequest, TResponse>

Wraps the handling of a streaming request.

IStreamRequestHandler<TRequest, TResponse>

Handles a streaming request.

IStreamRequest<TResponse>

A request whose handler produces a stream of TResponse items as an IAsyncEnumerable<T>.

Delegates

RequestHandlerDelegate<TResponse>

Continues the request pipeline: invokes the next behavior or, at the end, the handler.

StreamHandlerDelegate<TResponse>

Continues the stream pipeline: invokes the next behavior or, at the end, the stream handler.