Table of Contents

Delegate MapAsyncOperation<TInput, TResult>

Namespace
SodaFlow.Async
Assembly
SodaFlow.Core.Async.dll

The work that a MapAsync pipeline does for one value from the source stream. It gives a MapAsyncResult<TResult> and not a result, because the two answers are not the same: FromValue(TResult) carries a value that the operation has, and Construct(Func<TResult>) carries a function that the pipeline calls in the transaction that sends the result. Use the second one when the result contains a cell, a stream, or another part of a SodaFlow graph, because such a part must come into existence in that transaction.

[PublicAPI]
public delegate Task<MapAsyncResult<TResult>> MapAsyncOperation<in TInput, TResult>(TInput input, ResultFactory<TResult> resultFactory, CancellationToken token)

Parameters

input TInput

The value from the source stream, as the pipeline admitted it.

resultFactory ResultFactory<TResult>

Makes the two kinds of answer. It has no state.

token CancellationToken

Cancels this operation. It combines the cancellation of this item with the cancellation of the strategy. An operation that does not monitor it runs to its end, and the pipeline then does not publish its result.

Returns

Task<MapAsyncResult<TResult>>

A Task with the value, or with the function that makes the value.

Type Parameters

TInput

The type in the source stream.

TResult

The type that the pipeline publishes.

Extension Methods