ObjectSolutionState

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

Properties

CurrentId

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

Data

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

FaultException

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

Initial

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

Irrelevant

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

Phase

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

ProcessId

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

RelevantId

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

Methods

Cancel

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

Complete

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

Compute

#
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.
public ObjectSolutionState Compute(
upcomingId
)

Expire

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

Fault

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

ToString

#
public override string ToString()
Object.ToString