Table of Contents

Method CreateSessionProcessRunner

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

CreateSessionProcessRunner<TResult>(IActiveSession, Func<Action<TResult, int?>, CancellationToken, TResult>, HttpContext, IDisposable?)

Creates a SessionProcessRunner<TResult> instance in the specified Active Session: synchronous task, returns result, no external source for CompletionToken.

public static KeyedRunner<TResult> CreateSessionProcessRunner<TResult>(this IActiveSession Session, Func<Action<TResult, int?>, CancellationToken, TResult> ProcessTaskBody, HttpContext Context, IDisposable? ExclusiveServiceAccessor = null)

Parameters

Session IActiveSession
An interface of Active Session object to work with.
ProcessTaskBody Func<Action<TResult, int?>, CancellationToken, TResult>
A delegate that is used as a synchronously executing body of a background task.
Context HttpContext
Context of the HTTP request from a handler of which the method is called.
ExclusiveServiceAccessor IDisposable
The accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container. The accesor value may be null (this is the default value), that means the new runner will not use any exclusively accessible service from the active session's DI container.

Returns

KeyedRunner<TResult>

A structure that contains the reference to the new runner and its number within the active session.

Type Parameters

TResult
The type of the result returned by the interface methods of the runner. Values of this type are passed to a callback and a value of this type is optionally returned by a background task.

Remarks

Runners created by this method have the following features. An external source for CompletionToken property of the runner cannot be used. The runner will run a background task that executes the specified (synchronous) delegate returning the final result from the task.

CreateSessionProcessRunner<TResult>(IActiveSession, Action<Action<TResult, int?>, CancellationToken>, HttpContext, IDisposable?)

Creates a SessionProcessRunner<TResult> instance in the specified Active Session: synchronous task, does not return result, no external source for CompletionToken.

public static KeyedRunner<TResult> CreateSessionProcessRunner<TResult>(this IActiveSession Session, Action<Action<TResult, int?>, CancellationToken> ProcessTaskBody, HttpContext Context, IDisposable? ExclusiveServiceAccessor = null)

Parameters

Session IActiveSession
An interface of Active Session object to work with.
ProcessTaskBody Action<Action<TResult, int?>, CancellationToken>
A delegate that is used as a synchronously executing body of a background task.
Context HttpContext
Context of the HTTP request from a handler of which the method is called.
ExclusiveServiceAccessor IDisposable
The accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container. The accesor value may be null (this is the default value), that means the new runner will not use any exclusively accessible service from the active session's DI container.

Returns

KeyedRunner<TResult>

A structure that contains the reference to the new runner and its number within the active session.

Type Parameters

TResult
The type of the result returned by the interface methods of the runner. Values of this type are passed to a callback and a value of this type is optionally returned by a background task.

Remarks

Runners created by this method have the following features. An external source for CompletionToken property of the runner cannot be used. The runner will run a background task that executes the specified (synchronous) delegate without returning the final result from the task.

CreateSessionProcessRunner<TResult>(IActiveSession, Func<Action<TResult, int?>, CancellationToken, Task<TResult>>, HttpContext, IDisposable?)

Creates a SessionProcessRunner<TResult> instance in the specified Active Session: asynchronous task, returns result, no external source for CompletionToken.

public static KeyedRunner<TResult> CreateSessionProcessRunner<TResult>(this IActiveSession Session, Func<Action<TResult, int?>, CancellationToken, Task<TResult>> ProcessTaskCreator, HttpContext Context, IDisposable? ExclusiveServiceAccessor = null)

Parameters

Session IActiveSession
An interface of Active Session object to work with.
ProcessTaskCreator Func<Action<TResult, int?>, CancellationToken, Task<TResult>>
A delegate that is used to create a background task.
Context HttpContext
Context of the HTTP request from a handler of which the method is called.
ExclusiveServiceAccessor IDisposable
The accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container. The accesor value may be null (this is the default value), that means the new runner will not use any exclusively accessible service from the active session's DI container.

Returns

KeyedRunner<TResult>

A structure that contains the reference to the new runner and its number within the active session.

Type Parameters

TResult
The type of the result returned by the interface methods of the runner. Values of this type are passed to a callback and a value of this type is optionally returned by a background task.

Remarks

Runners created by this method have the following features. An external source for CompletionToken property of the runner cannot be used. The runner will run a background task created by the specified delegate returning the final result from the task.

CreateSessionProcessRunner<TResult>(IActiveSession, Func<Action<TResult, int?>, CancellationToken, Task>, HttpContext, IDisposable?)

Creates a SessionProcessRunner<TResult> instance in the specified Active Session: asynchronous task, does not return result, no external source for CompletionToken.

public static KeyedRunner<TResult> CreateSessionProcessRunner<TResult>(this IActiveSession Session, Func<Action<TResult, int?>, CancellationToken, Task> ProcessTaskCreator, HttpContext Context, IDisposable? ExclusiveServiceAccessor = null)

Parameters

Session IActiveSession
An interface of Active Session object to work with.
ProcessTaskCreator Func<Action<TResult, int?>, CancellationToken, Task>
A delegate that is used to create a background task.
Context HttpContext
Context of the HTTP request from a handler of which the method is called.
ExclusiveServiceAccessor IDisposable
The accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container. The accesor value may be null (this is the default value), that means the new runner will not use any exclusively accessible service from the active session's DI container.

Returns

KeyedRunner<TResult>

A structure that contains the reference to the new runner and its number within the active session.

Type Parameters

TResult
The type of the result returned by the interface methods of the runner. Values of this type are passed to a callback and a value of this type is optionally returned by a background task.

Remarks

Runners created by this method have the following features. An external source for CompletionToken property of the runner cannot be used. The runner will run a background task created by the specified delegate without returning the final result from the task.

CreateSessionProcessRunner<TResult>(IActiveSession, Func<Action<TResult, int?>, CancellationToken, TResult>, HttpContext, CancellationTokenSource, bool, IDisposable?)

Creates a SessionProcessRunner<TResult> instance in the specified Active Session: synchronous task, returns result, can use external source for CompletionToken.

public static KeyedRunner<TResult> CreateSessionProcessRunner<TResult>(this IActiveSession Session, Func<Action<TResult, int?>, CancellationToken, TResult> ProcessTaskBody, HttpContext Context, CancellationTokenSource CompletionTokenSource, bool PassCtsOwnership = true, IDisposable? ExclusiveServiceAccessor = null)

Parameters

Session IActiveSession
An interface of Active Session object to work with.
ProcessTaskBody Func<Action<TResult, int?>, CancellationToken, TResult>
A delegate that is used as a synchronously executing body of a background task.
Context HttpContext
Context of the HTTP request from a handler of which the method is called.
CompletionTokenSource CancellationTokenSource
External source for a value of the CompletionToken property. If it is null (default value), a new CancellationTokenSource will be used as the source in the instance to be created.
PassCtsOwnership bool
This value indicates will the instance to be created be responsible for disposing an external CompletionToken source if it was passed by CompletionTokenSource.
ExclusiveServiceAccessor IDisposable
The accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container. The accesor value may be null (this is the default value), that means the new runner will not use any exclusively accessible service from the active session's DI container.

Returns

KeyedRunner<TResult>

A structure that contains the reference to the new runner and its number within the active session.

Type Parameters

TResult
The type of the result returned by the interface methods of the runner. Values of this type are passed to a callback and a value of this type is optionally returned by a background task.

Remarks

Runners created by this method have the following features. An external source for CompletionToken property of the runner can be used. The runner will run a background task that executes the specified (synchronous) delegate returning the final result from the task.

CreateSessionProcessRunner<TResult>(IActiveSession, Action<Action<TResult, int?>, CancellationToken>, HttpContext, CancellationTokenSource, bool, IDisposable?)

Creates a SessionProcessRunner<TResult> instance in the specified Active Session: synchronous task, does not return result, can use external source for CompletionToken.

public static KeyedRunner<TResult> CreateSessionProcessRunner<TResult>(this IActiveSession Session, Action<Action<TResult, int?>, CancellationToken> ProcessTaskBody, HttpContext Context, CancellationTokenSource CompletionTokenSource, bool PassCtsOwnership = true, IDisposable? ExclusiveServiceAccessor = null)

Parameters

Session IActiveSession
An interface of Active Session object to work with.
ProcessTaskBody Action<Action<TResult, int?>, CancellationToken>
A delegate that is used as a synchronously executing body of a background task.
Context HttpContext
Context of the HTTP request from a handler of which the method is called.
CompletionTokenSource CancellationTokenSource
External source for a value of the CompletionToken property. If it is null (default value), a new CancellationTokenSource will be used as the source in the instance to be created.
PassCtsOwnership bool
This value indicates will the instance to be created be responsible for disposing an external CompletionToken source if it was passed by CompletionTokenSource.
ExclusiveServiceAccessor IDisposable
The accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container. The accesor value may be null (this is the default value), that means the new runner will not use any exclusively accessible service from the active session's DI container.

Returns

KeyedRunner<TResult>

A structure that contains the reference to the new runner and its number within the active session.

Type Parameters

TResult
The type of the result returned by the interface methods of the runner. Values of this type are passed to a callback and a value of this type is optionally returned by a background task.

Remarks

Runners created by this method have the following features. An external source for CompletionToken property of the runner can be used. The runner will run a background task that executes the specified (synchronous) delegate without returning the final result from the task.

CreateSessionProcessRunner<TResult>(IActiveSession, Func<Action<TResult, int?>, CancellationToken, Task<TResult>>, HttpContext, CancellationTokenSource, bool, IDisposable?)

Creates a SessionProcessRunner<TResult> instance in the specified Active Session: asynchronous task, returns result, can use external source for CompletionToken.

public static KeyedRunner<TResult> CreateSessionProcessRunner<TResult>(this IActiveSession Session, Func<Action<TResult, int?>, CancellationToken, Task<TResult>> ProcessTaskCreator, HttpContext Context, CancellationTokenSource CompletionTokenSource, bool PassCtsOwnership = true, IDisposable? ExclusiveServiceAccessor = null)

Parameters

Session IActiveSession
An interface of Active Session object to work with.
ProcessTaskCreator Func<Action<TResult, int?>, CancellationToken, Task<TResult>>
A delegate that is used to create a background task.
Context HttpContext
Context of the HTTP request from a handler of which the method is called.
CompletionTokenSource CancellationTokenSource
External source for a value of the CompletionToken property. If it is null (default value), a new CancellationTokenSource will be used as the source in the instance to be created.
PassCtsOwnership bool
This value indicates will the instance to be created be responsible for disposing an external CompletionToken source if it was passed by CompletionTokenSource.
ExclusiveServiceAccessor IDisposable
The accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container. The accesor value may be null (this is the default value), that means the new runner will not use any exclusively accessible service from the active session's DI container.

Returns

KeyedRunner<TResult>

A structure that contains the reference to the new runner and its number within the active session.

Type Parameters

TResult
The type of the result returned by the interface methods of the runner. Values of this type are passed to a callback and a value of this type is optionally returned by a background task.

Remarks

Runners created by this method have the following features. An external source for CompletionToken property of the runner can be used. The runner will run a background task created by the specified delegate returning the final result from the task.

CreateSessionProcessRunner<TResult>(IActiveSession, Func<Action<TResult, int?>, CancellationToken, Task>, HttpContext, CancellationTokenSource, bool, IDisposable?)

Creates a SessionProcessRunner<TResult> instance in the specified Active Session: asynchronous task, does not return result, can use external source for CompletionToken.

public static KeyedRunner<TResult> CreateSessionProcessRunner<TResult>(this IActiveSession Session, Func<Action<TResult, int?>, CancellationToken, Task> ProcessTaskCreator, HttpContext Context, CancellationTokenSource CompletionTokenSource, bool PassCtsOwnership = true, IDisposable? ExclusiveServiceAccessor = null)

Parameters

Session IActiveSession
An interface of Active Session object to work with.
ProcessTaskCreator Func<Action<TResult, int?>, CancellationToken, Task>
A delegate that is used to create a background task.
Context HttpContext
Context of the HTTP request from a handler of which the method is called.
CompletionTokenSource CancellationTokenSource
External source for a value of the CompletionToken property. If it is null (default value), a new CancellationTokenSource will be used as the source in the instance to be created.
PassCtsOwnership bool
This value indicates will the instance to be created be responsible for disposing an external CompletionToken source if it was passed by CompletionTokenSource.
ExclusiveServiceAccessor IDisposable
The accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container. The accesor value may be null (this is the default value), that means the new runner will not use any exclusively accessible service from the active session's DI container.

Returns

KeyedRunner<TResult>

A structure that contains the reference to the new runner and its number within the active session.

Type Parameters

TResult
The type of the result returned by the interface methods of the runner. Values of this type are passed to a callback and a value of this type is optionally returned by a background task.

Remarks

Runners created by this method have the following features. An external source for CompletionToken property of the runner can be used. The runner will run a background task created by the specified delegate without returning the final result from the task.