Table of Contents

Method GetAvailableAsync

Namespace
MVVrus.AspNetCore.ActiveSession
Assembly
MVVrus.AspNetCore.ActiveSession.dll

GetAvailableAsync<TResult>(IRunner<TResult>, int, int, string?, CancellationToken)

A universal method of calling a method GetAvailable(int, int, string?) for both local and remote runners.

public static ValueTask<RunnerResult<TResult>> GetAvailableAsync<TResult>(this IRunner<TResult> Runner, int Advance = 2147483647, int StartPosition = -1, string? TraceIdentifier = null, CancellationToken Token = default)

Parameters

Runner IRunner<TResult>
An instance of a runner for which the method is called.
Advance int
Desired increment of the runner's Position, at which the fetch should stop. If the backgound process did not get so far, this method returns the result for the last Position reached. In general, the value of this param should be positive, zero ( DEFAULT_ADVANCE) value having a special meaning.
StartPosition int
Position value from which a fetch of the result should begin. In general, value of this parameter should be non-negative (except for the special value below) and not less than value of the Position property. Use CURRENT_POSITION constant to continue to fetch result from the last position fetched.
TraceIdentifier string
String that can be used for tracing.
Token CancellationToken
Can be used for cooperative cancellation of the operation initiated by this method (i.e. cancellation of the result task).

Returns

ValueTask<RunnerResult<TResult>>
A ValueTask<TResult> wrapping a value returned by GetAvailable(int, int, string?) method call (possibly from a remote host)

Type Parameters

TResult

The type of the result returned by the interface methods of the runner.