Interface TaskChain<T>


public interface TaskChain<T>
A scope-owned continuation chain. Results are observed through the owning TaskScope.
  • Method Summary

    Modifier and Type
    Method
    Description
    <R> TaskChain<R>
    map(Function<? super T,? extends R> fn)
    Transforms the success value once available.
    recover(Function<? super Throwable,? extends T> fn)
    Supplies a fallback value if this chain fails.
    default TaskChain<Void>
    thenAccept(Consumer<? super T> fn)
    Runs a side effect on success and yields a Void chain.
  • Method Details

    • map

      <R> TaskChain<R> map(Function<? super T,? extends R> fn)
      Transforms the success value once available. Failures/cancellation pass through untouched.
    • recover

      TaskChain<T> recover(Function<? super Throwable,? extends T> fn)
      Supplies a fallback value if this chain fails. Unlike CompletableFuture.exceptionally, a cancelled chain is not recovered (cancellation propagates) and the fallback receives the unwrapped cause.
    • thenAccept

      default TaskChain<Void> thenAccept(Consumer<? super T> fn)
      Runs a side effect on success and yields a Void chain.