Skip to content

IStreamPipelineBehavior<TMessage, TResult> interface

Namespace: Vitreous.Abstractions
Assembly: Vitreous.dll

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.

public interface IStreamPipelineBehavior<TMessage, TResult> where TMessage : IStreamQuery<TResult>

TMessage

The stream query type — must implement IStreamQuery<TResult>.

TResult

The type of each item yielded by the stream.

Handle(TMessage, StreamQueryHandlerDelegate<TMessage, TResult>, CancellationToken)

Section titled “ Handle(TMessage, StreamQueryHandlerDelegate<TMessage, TResult>, CancellationToken)”

Executes this behavior step, calling next to continue the pipeline.

ValueTask<Result<IAsyncEnumerable<TResult>>> Handle(TMessage message, StreamQueryHandlerDelegate<TMessage, TResult> next, CancellationToken ct = default)

message TMessage

next StreamQueryHandlerDelegate<TMessage, TResult>

ct CancellationToken

ValueTask<Result<IAsyncEnumerable<TResult>>>