Interface Cancelable<R>

Type Parameters:
R -

public interface Cancelable<R>
Implementation agnostic interface for asynchronous delayed and optionally repeated executions.

Implementations may use JVM-local backends, like Java executors or Vert.X. Vert.X's API is not based on Java's (Completable)Future or CompletionStage. The cancellation semantics/guarantees are different for Vert.X and Java.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Attempt to cancel the delayed execution of a callable.
    Retrieve the CompletionStage associated with this Cancelable for the submitted async and potentially periodic execution.
  • Method Details

    • cancel

      void cancel()
      Attempt to cancel the delayed execution of a callable. Already running callables are not interrupted. A callable may still be invoked after calling this function, because of side effects and race conditions.

      After cancellation, the result of this instance's might be either in state "completed exceptionally" (CancellationException) or successfully completed.

    • completionStage

      CompletionStage<R> completionStage()
      Retrieve the CompletionStage associated with this Cancelable for the submitted async and potentially periodic execution.