Skip to content

ISender interface

Namespace: Vitreous.Abstractions
Assembly: Vitreous.dll

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

public interface ISender

StreamQueryExtensions.CollectStream<TResult>(ISender, IStreamQuery<TResult>, CancellationToken)

CreateStream<TResult>(IStreamQuery<TResult>, CancellationToken)

Section titled “ CreateStream<TResult>(IStreamQuery<TResult>, CancellationToken)”

Opens a stream query and returns a lazy sequence of TResult items. The Result<T> wrapper allows setup failures (validation, authorization) to be signalled before any item is produced. Once the stream is open, items flow as plain TResult.

ValueTask<Result<IAsyncEnumerable<TResult>>> CreateStream<TResult>(IStreamQuery<TResult> query, CancellationToken ct = default)

query IStreamQuery<TResult>

ct CancellationToken

ValueTask<Result<IAsyncEnumerable<TResult>>>

TResult

Send<TResult>(ICommand<TResult>, CancellationToken)

Section titled “ Send<TResult>(ICommand<TResult>, CancellationToken)”

Sends a command that returns a value of type TResult.

ValueTask<Result<TResult>> Send<TResult>(ICommand<TResult> command, CancellationToken ct = default)

command ICommand<TResult>

ct CancellationToken

ValueTask<Result<TResult>>

TResult

Sends a command that does not return a meaningful value.

ValueTask<Result> Send(ICommand command, CancellationToken ct = default)

command ICommand

ct CancellationToken

ValueTask<Result>

Send<TResult>(IQuery<TResult>, CancellationToken)

Section titled “ Send<TResult>(IQuery<TResult>, CancellationToken)”

Sends a query that returns a value of type TResult.

ValueTask<Result<TResult>> Send<TResult>(IQuery<TResult> query, CancellationToken ct = default)

query IQuery<TResult>

ct CancellationToken

ValueTask<Result<TResult>>

TResult