Table of Contents

Class EnumAdapterRunner<TItem>

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

This class implements a sequence-oriented runner that is an adapter for an object implementing the IEnumerable<TItem> interface. The adapter enumerates this enumerable object in background and returns parts of resulting sequence in order via IRunner<TResult> interface with TResult being IEnumerable<TItem>

public class EnumAdapterRunner<TItem> : EnumerableRunnerBase<TItem>, IDisposable, IRunner<IEnumerable<TItem>>, IRunner, IAsyncDisposable, ICriticalNotifyCompletion, INotifyCompletion

Type Parameters

TItem
Inheritance
EnumAdapterRunner<TItem>
Implements
Inherited Members
Extension Methods

Remarks

Sequence-oriented runners are ones that return a sequence of data records as a result. These runners implements IRunner<TResult> interface, with TResult type being an implementation of IEnumerable<TItem> interface.

Sequence-oriented runners returns parts of a sequence produced in a background by some process. The parts are returned via calls of GetRequiredAsync and/or GetAvailable methods. These parts may be obtained during processing of different HTTP requests belonging to one Active Session. All calls to these methods must be made in order and calls of these methods must not be made in parallel.

Constructors

EnumAdapterRunner(EnumAdapterParams<TItem>, RunnerId, IOptionsSnapshot<ActiveSessionOptions>, ILogger<EnumAdapterRunner<TItem>>?)

A constructor that creates EnumAdapterRunner instance. This constructor is used to create an instance by TypeRunnerFactory

EnumAdapterRunner(IEnumerable<TItem>, RunnerId, IOptionsSnapshot<ActiveSessionOptions>, ILogger<EnumAdapterRunner<TItem>>?)

A constructor that creates EnumAdapterRunner instance. This constructor is used to create an instance by TypeRunnerFactory

EnumAdapterRunner(IEnumerable<TItem>, bool, CancellationTokenSource?, bool, int?, int?, bool, RunnerId, IOptionsSnapshot<ActiveSessionOptions>, ILogger?)

A constructor that creates EnumAdapterRunner instance. This constructor has protected access level and is intended for use in other constructors of this and descendent classes.

Methods

DisposeAsyncCore()

Protected, overrides EnumerableRunnerBase.DisposeAsyncCore. This method performs a real work of disposing the object instance asynchronously.

DoAbort(string)

Protected, overrides EnumerableRunnerBase.DoAbort method. This method performs and additional work for implementing the Abort(string?) method.

FetchRequiredAsync(int, List<TItem>, CancellationToken, string)

Protected, overrides EnumerableRunnerBase.FetchRequiredAsync abstract method. Creates a task representing an asynchronous fetch of results of the background processing to be returned by GetRequiredAsync method.

PreDispose()

Protected, overrides EnumerableRunnerBase.PreDispose. Performs preliminary tasks before beginning of disposing any members of any descendent class.

StartBackgroundExecution()

Protected, overrides RunnerBase.StartBackgroundExecution abstract method. This method is used to start background execution synchronously.