ObjectSolutionState

References
public sealed class ObjectSolutionState
An immutable, thread-safe class aggregating all fields relevant to object solutions.

Properties

CurrentId

#
public SolutionId CurrentId { get; }
Gets the solution id associated with the currently available Data.

Data

#
public SolutionData Data { get; }
Gets the result computed by the most recent successful solution. This can be null.

FaultException

#
public Exception FaultException { get; }
Gets the exception which caused a faulted phase. This will be null whenever the Phase is not Phase.Faulted.

Initial

#
public static ObjectSolutionState Initial { get; }
Create the initial state assigned to active objects at construction.

Irrelevant

#
public static ObjectSolutionState Irrelevant { get; }
Create an irrelevant state which is assigned to non-active objects at construction.

Phase

#
public Phase Phase { get; }
Gets the phase of this state.

ProcessId

#
public SolutionId ProcessId { get; }
Gets the SolutionId of the currently computing solution, or the cancelled/faulted solution.

RelevantId

#
public SolutionId RelevantId { get; }
Gets either the ProcessId if it is valid, or the CurrentId if it is not.

Methods

Cancel

#
public ObjectSolutionState Cancel(SolutionId cancelledId)
Move this state into the Cancelled phase.
cancelledId (SolutionId)

Complete

#
public ObjectSolutionState Complete(SolutionData newResult)
Move this state into the Completed phase.
newResult (SolutionData)

Compute

#
public ObjectSolutionState Compute(SolutionId upcomingId)
Move this state into the Computing phase. If the awaitingTask has finished (Faulted, Cancelled, or RanToCompletion), then this method will return instead of a modified state.
upcomingId (SolutionId)

Expire

#
public ObjectSolutionState Expire()
Move this state into the Expired phase.

Fault

#
public ObjectSolutionState Fault(SolutionId faultedId, Exception exception)
Move this state into the Faulted phase.
faultedId (SolutionId)
exception (Exception)

ToString

#
public override string ToString()
Object.ToString