Search Results for

    Show / Hide Table of Contents

    Interface ICancelable

    Signifies something that can be canceled

    Namespace: Akka.Actor
    Assembly: Akka.dll
    Syntax
    public interface ICancelable

    Properties

    | Edit this page View Source

    IsCancellationRequested

    Gets a value indicating whether cancellation has been requested

    Declaration
    bool IsCancellationRequested { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Token

    Gets the CancellationToken associated with this ICancelable.

    Declaration
    CancellationToken Token { get; }
    Property Value
    Type Description
    CancellationToken

    Methods

    | Edit this page View Source

    Cancel()

    Communicates a request for cancellation.

    Declaration
    void Cancel()
    Remarks

    The associated cancelable will be notified of the cancellation and will transition to a state where IsCancellationRequested returns true. Any callbacks or cancelable operations registered with the cancelable will be executed. Cancelable operations and callbacks registered with the token should not throw exceptions. However, this overload of Cancel will aggregate any exceptions thrown into an AggregateException, such that one callback throwing an exception will not prevent other registered callbacks from being executed. The ExecutionContext that was captured when each callback was registered will be reestablished when the callback is invoked.

    | Edit this page View Source

    Cancel(bool)

    Communicates a request for cancellation, and specifies whether remaining callbacks and cancelable operations should be processed.

    Declaration
    void Cancel(bool throwOnFirstException)
    Parameters
    Type Name Description
    bool throwOnFirstException

    true if exceptions should immediately propagate; otherwise, false.

    Remarks

    The associated cancelable will be notified of the cancellation and will transition to a state where IsCancellationRequested returns true. Any callbacks or cancelable operations registered with the cancelable will be executed. Cancelable operations and callbacks registered with the token should not throw exceptions. If throwOnFirstException is true, an exception will immediately propagate out of the call to Cancel, preventing the remaining callbacks and cancelable operations from being processed. If throwOnFirstException is false, this overload will aggregate any exceptions thrown into an AggregateException, such that one callback throwing an exception will not prevent other registered callbacks from being executed. The ExecutionContext that was captured when each callback was registered will be reestablished when the callback is invoked.

    | Edit this page View Source

    CancelAfter(int)

    Schedules a cancel operation on this cancelable after the specified number of milliseconds.

    Declaration
    void CancelAfter(int millisecondsDelay)
    Parameters
    Type Name Description
    int millisecondsDelay

    The delay in milliseconds before this instance is canceled.

    | Edit this page View Source

    CancelAfter(TimeSpan)

    Schedules a cancel operation on this cancelable after the specified delay.

    Declaration
    void CancelAfter(TimeSpan delay)
    Parameters
    Type Name Description
    TimeSpan delay

    The delay before this instance is canceled.

    Extension Methods

    CancelableExtensions.CancelIfNotNull(ICancelable)
    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET