Was this page helpful?

WithCleanup Method

    WithCleanup(Action<Result> callback)

    public Result WithCleanup(Action<Result> callback);
    Register a clean-up callback to allow disposal of System.IDisposable resources used in invocation.

    Remarks

    Doing clean-up in Result.WhenDone(Action<Result> handler) is not safe, since the completion may have been triggered by a cancel, while the the invokee has not acknowledged the cancel and is still using the resource.

    Parameters

    Name Type Description
    callback Action<Result> Callback action on completion of the invokee.

    Returns

    Type: Result
    The current result index.
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by