Delegate MapAsyncOperation<TInput, TResult>
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
inputTInputThe value from the source stream, as the pipeline admitted it.
resultFactoryResultFactory<TResult>Makes the two kinds of answer. It has no state.
tokenCancellationTokenCancels 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
TInputThe type in the source stream.
TResultThe type that the pipeline publishes.
- Extension Methods