Was this page helpful?

Result Class

    Table of contents
    1. 1. Members
      1. 1.1. Constructors
      2. 1.2. Fields
      3. 1.3. Properties
      4. 1.4. Methods
    Table of Contents
    public sealed class Result
    Namespace: MindTouch.Tasking
    Assembly: mindtouch.dream
    Type Hierarchy:
    Implements:
    A value-less implemenation of MindTouch.Tasking.AResult. Use MindTouch.Tasking.Result<T> if the invoked action needs to return a value.

    Members

    Constructors

    Visibility Description
    Public Result() Create a new instance with the default timeout.
    Public Result(TimeSpan timeout) Create a new instance with a timeout.
    Public Result(TaskEnv env) Create a new instance with a given environment.
    Public Result(TimeSpan timeout, TaskEnv env) Create a new instance with a given environment and timeout

    Fields

    Visibility Description
    Protected _state The current state of the Result.
    Protected _env The task environment to execute the callbacks in.

    Properties

    Visibility Description
    Public ValueType (Override) Type of value that the result encapsulates (if any).
    Public UntypedValue (Override) This method will throw System.InvalidOperationException, because this implementation of MindTouch.Tasking.AResult does not have a value
    Protected HasCleanup (Override) True if the instance has a clean-up callback.
    Public HasException The result has an exception set on it. (Inherited from AResult)
    Public HasValue The result has a value set on it. (Inherited from AResult)
    Public HasTimedOut The result has failed to complete because it timed out. (Inherited from AResult)
    Public IsCanceled The result will not complete because it was canceled. (Inherited from AResult)
    Public HasFinished The action using the result as a synchronization handle has completed. (Inherited from AResult)
    Public Timeout Amount of time this result will wait before it has to be signaled to succeed. (Inherited from AResult)
    Public Env The environment in which this result is being used. (Inherited from AResult)
    Public Exception The exception set on the result if AResult.HasException is True. (Inherited from AResult)
    Protected HasCompletion True if the Result has a completion callback. (Inherited from AResult)

    Methods

    Visibility Description
    Public WithCleanup(Action<Result> callback) Register a clean-up callback to allow disposal of System.IDisposable resources used in invocation.
    Protected CallCleanupCanceled() (Override) Try to call the clean-up callback on result cancelation.
    Protected CallCleanupError(Exception exception) (Override) Try to call the clean-up callback on result error.
    Public Block() Block on the current thread until the result completes either successfully or with an exception.
    Public Block(AutoResetEvent signal) Block on the current thread until the result completes either successfully or with an exception.
    Public WhenDone(Action<Result> handler) Register a callback handler that is invoked when the result completes.
    Public WhenDone(Action success, Action<Exception> error) Register a success and an error callback handler for invocation depending on result completion.
    Public Return() Set successful completion on the result. Will throw System.InvalidOperationException if the result can not transition into the successful completion state.
    Public TryReturn() Try to set successful completion on the result. Unlike Result.Return() and Result.Return(Result result) does not throw.
    Public Return(Result result) Use another MindTouch.Tasking.Result's completion to trigger completion of this instance.
    Public Confirm() Confirm that the result does not have an exception. If it has a an exception, it will be rethrown by this call. (Inherited from AResult)
    Public Throw(Exception exception) Set an exception on the result. (Inherited from AResult)
    Public Cancel() Mark the handle as canceled, to notify the pending action that execution should be aborted. (Inherited from AResult)
    Public ConfirmCancel() Signal that the executing end has acknowledged the cancel action of the invokee. (Inherited from AResult)
    Protected EnsureFinished() Behaves as a no-op if the result has finished, otherwise throws System.InvalidProgramException. (Inherited from AResult)
    Protected SetStateError(Exception exception) Try to set the state to AResult.ResultState.Error. (Inherited from AResult)
    Protected SetStateCancel(Exception exception) Try to set the state to AResult.ResultState.Cancel. (Inherited from AResult)
    Protected SetStateConfirmCancel() Try to set the state to AResult.ResultState.ConfirmedCancel. Will throw System.InvalidOperationException if the state transition is invalid. (Inherited from AResult)
    Protected CallCompletion() Cancels any internal timer and calls the completion. (Inherited from AResult)
    Public Block() Block on the current thread until the result completes either successfully or with an exception. (Inherited from AResult)
    Public Block(AutoResetEvent signal) Block on the current thread until the result completes either successfully or with an exception. (Inherited from AResult)
    Public Wait() Block on the current thread until the result completes. Will throw if an exception triggers completion. (Inherited from AResult)
    Public Wait(AutoResetEvent signal) Block on the current thread until the result completes. Will throw if an exception triggers completion. (Inherited from AResult)
    Public WhenDone(Action<AResult> handler) Register a callback handler that is invoked when the result completes. (Inherited from AResult)
    Protected WhenDone(Action<TResult> completion) Register a callback for result completion. (Inherited from AResult)
    Public ToString() (Inherited from Object)
    Public Equals(object obj) (Inherited from Object)
    Public GetHashCode() (Inherited from Object)
    Public GetType() (Inherited from Object)
    Protected MemberwiseClone() (Inherited from Object)
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by