Table of Contents

Method SetStatus

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

SetStatus(RunnerStatus, bool)

Protected. Sets the Status property enforcing rules for changing this property.

protected bool SetStatus(RunnerStatus Status, bool DoNotComplete = false)

Parameters

Status RunnerStatus

The new value for the Status property.

DoNotComplete bool

Do not singnal the runner completion (cancel CompletionToken) in this call if it comes to a final status. If this parameter is set, one should call CheckCompletion() method later to signal completion.

Returns

bool

true if the Status property value has really been changed, false otherwise.

Remarks

The enforced rules rules are the following:

  1. The Status value of NotStarted cannot be changed. I.e. this method cannot be used to start a background execution of a runner. Use StartRunning(RunnerStatus) or StartRunningAsync(RunnerStatus) instead.
  2. If the Status value is a final one it will not be changed.
  3. The Status value cannot be set to NotStarted.
The value of the property is set in a thread-safe manner. If the value of the property become a final one the CompletionToken will go to Canceled state.