Skip to content

Vitreous.Abstractions namespace

StreamQueryHandler<TQuery, TResult>

Optional base class for stream query handlers that eliminates the mandatory two-method split imposed by C#’s restriction on mixing yield return with ValueTask<Result<IAsyncEnumerable<T>>> returns.

ICommand

Marker interface for a command that mutates state and does not return a meaningful value. Handled by a single ICommandHandler<TCommand>.

ICommand<TResult>

Marker interface for a command that mutates state and returns a value of type TResult. Handled by a single ICommandHandler<TCommand, TResult>.

ICommandHandler<TCommand, TResult>

Handles a command that returns a value of type TResult.

ICommandHandler<TCommand>

Handles a command that does not return a meaningful value.

INotification

Marker interface for a notification — a fire-and-forget event dispatched to zero or more handlers. Unlike commands and queries, notifications do not return a value.

INotificationHandler<TNotification>

Handles a notification of type TNotification. Multiple handlers may be registered for the same notification type.

INotificationPipelineBehavior<TNotification>

Cross-cutting behavior that wraps the dispatch of a notification.

IPipelineBehavior<TMessage, TResult>

Cross-cutting behavior that wraps the dispatch of any message: commands returning TResult, queries, and void commands (where TResult is Unit).

IPublisher

Publishes notifications to all registered handlers using the configured fan-out strategy (default: sequential, fail-fast).

IQuery<TResult>

Marker interface for a query that reads state and returns a value of type TResult. Queries should be side-effect free and idempotent. Handled by a single IQueryHandler<TQuery, TResult>.

IQueryHandler<TQuery, TResult>

Handles a query that reads state and returns a value of type TResult.

ISender

Dispatches commands and queries to their registered handlers, executing any registered pipeline behaviors along the way.

IStreamPipelineBehavior<TMessage, TResult>

Cross-cutting behavior that wraps the dispatch of a stream query. Behaviors execute before the stream is opened and can short-circuit with a Result<T> failure before any item is produced.

IStreamQuery<TResult>

Marker interface for a query that reads state and produces a stream of values of type TResult lazily over time. Handled by a single IStreamQueryHandler<TQuery, TResult>.

IStreamQueryHandler<TQuery, TResult>

Handles a stream query that reads state and produces items of type TResult lazily over time.

CommandHandlerDelegate<TCommand>

A delegate representing the terminal step of a void-command pipeline. The handler still returns the non-generic Result; the executor adapts it to Result<Unit> before passing it through behaviors.

MessageHandlerDelegate<TMessage, TResult>

A delegate representing the next step in a command/query pipeline. The message and cancellation token are passed explicitly to avoid closure allocations.

NotificationHandlerDelegate<TNotification>

A delegate representing the next step in a notification pipeline.

StreamQueryHandlerDelegate<TMessage, TResult>

A delegate representing the next step in a stream query pipeline. Returns a Result<T> wrapping the lazy IAsyncEnumerable<T> so that setup failures short-circuit before any item is produced.