Class RunnerBase
- Namespace
- MVVrus.AspNetCore.ActiveSession
- Assembly
- MVVrus.AspNetCore.ActiveSession.dll
An abstract class intended to be used as a base for runner classes implementing IRunner<TResult>
public abstract class RunnerBase : IRunner, IDisposable
- Inheritance
-
RunnerBase
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
- RunnerBase(CancellationTokenSource?, bool, RunnerId, ILogger?)
Protected. A RunnerBase instance constructor intended to be used by decendent classes constructors.
Properties
- CompletionToken
The CancellationToken that will be cancelled then the runner execution is completed. It is a part of IRunner interface implementation.
- Exception
The exception that causes the runner to come to the Failed status, otherwise - null. It is a part of IRunner interface implementation.
- ExtraData
Allows attach and access to arbitrary data attached to thr runner
- IsBackgroundExecutionCompleted
Indicate whether the background operation is completed.
- Position
Virtual.
Current position of the runner object. It is a part of IRunner interface implementation.
- Status
Virtual.
Current status of the runner object. It is a part of IRunner interface implementation.
Methods
- Abort(string?)
Method that terminates the runner execution. It is a part of IRunner interface implementation.
- CheckCompletion()
Signal the runner completion due to a transition to a final state if it was dellayed in the previous SetStatus(RunnerStatus, bool) call.
- CheckDisposed()
Protected. Checks that the instance is not disposed. Throws ObjectDisposedException otherwise.
- Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. It is a part of IDisposable interface implementation.
- Dispose(bool)
Protected virtual.
This method performs a real work of disposing the object instance (synchronously).
- Disposed()
Protected. Allows to check if the disposing this runner instance has been at least started already.
- DisposedObjectName()
Protected. Returns object name for an ObjectDisposedException to be thrown
- DoAbort(string)
Protected virtual.
This method performs and additional work for implementing the Abort(string?) method. It is intended to be overriden in descendent classes.
- FailStartRunning(RunnerStatus, Exception)
Protected. Rolls back the value of the Status property in the case of unsuccessful start of background execution.
- GetProgress()
Returns information about progress of background operation of a runner.
- LogFinishBackgroundProcess()
Protected. Write message about comletion of a renner background process.
- PreDispose()
Protected virtual.
Performs preliminary tasks before beginning of disposing any members of any descendent class.
- SetDisposed()
Protected. Changes state of the object to flag that its disposing is started (synchronously or asynchronously).
- SetStatus(RunnerStatus, bool)
Protected. Sets the Status property enforcing rules for changing this property.
- StartBackgroundExecution()
Protected abstract.
This method is used to start background execution synchronously.
- StartBackgroundExecutionAsync()
Protected virtual.
This method intended to start the background execution asynchronously.
- StartRunning(RunnerStatus)
Protected. Begins background execution of the runner if it is not started, and in that case sets the runner's Status property to the specified value.
- StartRunningAsync(RunnerStatus)
Protected. Asynchronously begins background execution of the runner if it has not been started yet, and in that case sets the runner's Status property to the specified value.