Class CompletionSingle<T>

java.lang.Object
io.helidon.common.reactive.CompletionAwaitable<T>
io.helidon.common.reactive.CompletionSingle<T>
Type Parameters:
T - payload type
All Implemented Interfaces:
Awaitable<T>, Single<T>, Subscribable<T>, CompletionStage<T>, Flow.Publisher<T>

public abstract class CompletionSingle<T> extends CompletionAwaitable<T> implements Single<T>
Single as CompletionStage.
  • Constructor Details

    • CompletionSingle

      protected CompletionSingle()
      Create a new completion single using toNullableStage() as a supplier for CompletionAwaitable.setOriginalStage(java.util.function.Supplier).
  • Method Details

    • toNullableStage

      protected CompletableFuture<T> toNullableStage()
      Create a new nullable completable future from this single.
      Returns:
      a new nullable completable future
    • onCancel

      public Single<T> onCancel(Runnable onCancel)
      Description copied from interface: Single
      Executes given Runnable when a cancel signal is received.
      Specified by:
      onCancel in interface Single<T>
      Specified by:
      onCancel in interface Subscribable<T>
      Parameters:
      onCancel - Runnable to be executed.
      Returns:
      Single
    • cancel

      public Single<T> cancel()
      Description copied from interface: Single
      Cancel upstream.
      Specified by:
      cancel in interface Single<T>
      Returns:
      new Single for eventually received single value.