Vitreous.Abstractions namespace
Classes
Section titled “Classes”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.
Interfaces
Section titled “Interfaces”Marker interface for a command that mutates state and does not return a meaningful value. Handled by a single ICommandHandler<TCommand>.
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.
Handles a command that does not return a meaningful value.
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).
Publishes notifications to all registered handlers using the configured fan-out strategy (default: sequential, fail-fast).
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.
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.
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.
Delegates
Section titled “Delegates”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.