接口的使用
cn.wjybxx.concurrent.ICompletionStage
使用ICompletionStage的程序包
-
cn.wjybxx.concurrent中ICompletionStage的使用
修饰符和类型接口说明interfaceIFuture<T>1.Future是任务和用户之间通信的媒介。interfaceIPromise<T>interface定时任务关联的Future。interface定时任务关联的Promise修饰符和类型类说明class提供转发功能的基类 由于Future中存在取消接口,因此该类还不是Readonly的。classPromise<T>声明IFuture接口加快instanceof测试final class为IPromise提供只读视图class修饰符和类型方法说明<X extends Throwable>
ICompletionStage<T> ICompletionStage.catching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends T> fallback) <X extends Throwable>
ICompletionStage<T> ICompletionStage.catching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends T> fallback, IContext ctx, int options) 它表示能从从特定的异常中恢复,并返回一个正常结果。<X extends Throwable>
ICompletionStage<T> ICompletionStage.catchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends T> fallback) <X extends Throwable>
ICompletionStage<T> ICompletionStage.catchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends T> fallback, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.composeApply(BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeApply(BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn, IContext ctx, int options) 该方法表示在当前Future与返回的Future中插入一个异步操作,构建异步管道 => 这是链式调用的核心API。<U> ICompletionStage<U> ICompletionStage.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <X extends Throwable>
ICompletionStage<T> ICompletionStage.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback) <X extends Throwable>
ICompletionStage<T> ICompletionStage.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback, IContext ctx, int options) 它表示能从从特定的异常中恢复,并异步返回一个正常结果。<X extends Throwable>
ICompletionStage<T> ICompletionStage.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback) <X extends Throwable>
ICompletionStage<T> ICompletionStage.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options) 它表示既能接收任务的正常结果,也可以接收任务异常结果,并异步返回一个运算结果。<U> ICompletionStage<U> ICompletionStage.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.handle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, Throwable, ? extends U> fn) <U> ICompletionStage<U> ICompletionStage.handle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, Throwable, ? extends U> fn, IContext ctx, int options) 该方法表示既能处理当前计算的正常结果,又能处理当前结算的异常结果(可以将异常转换为新的结果),并返回一个新的结果。<U> ICompletionStage<U> ICompletionStage.handleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, Throwable, ? extends U> fn) <U> ICompletionStage<U> ICompletionStage.handleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, Throwable, ? extends U> fn, IContext ctx, int options) ICompletionStage.thenAccept(BiConsumer<? super IContext, ? super T> action) ICompletionStage.thenAccept(BiConsumer<? super IContext, ? super T> action, IContext ctx, int options) 该方法返回一个新的Future,它的结果由当前Future驱动。ICompletionStage.thenAcceptAsync(Executor executor, BiConsumer<? super IContext, ? super T> action) ICompletionStage.thenAcceptAsync(Executor executor, BiConsumer<? super IContext, ? super T> action, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.thenApply(BiFunction<? super IContext, ? super T, ? extends U> fn) <U> ICompletionStage<U> ICompletionStage.thenApply(BiFunction<? super IContext, ? super T, ? extends U> fn, IContext ctx, int options) 该方法返回一个新的Future,它的结果由当前Future驱动。<U> ICompletionStage<U> ICompletionStage.thenApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends U> fn) <U> ICompletionStage<U> ICompletionStage.thenApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends U> fn, IContext ctx, int options) <U> ICompletionStage<U> <U> ICompletionStage<U> 该方法返回一个新的Future,它的结果由当前Future驱动。<U> ICompletionStage<U> ICompletionStage.thenCallAsync(Executor executor, Function<? super IContext, ? extends U> fn) <U> ICompletionStage<U> ICompletionStage.thenCallAsync(Executor executor, Function<? super IContext, ? extends U> fn, IContext ctx, int options) 该方法返回一个新的Future,它的结果由当前Future驱动。ICompletionStage.thenRunAsync(Executor executor, Consumer<? super IContext> action) ICompletionStage.thenRunAsync(Executor executor, Consumer<? super IContext> action, IContext ctx, int options) ICompletionStage.whenComplete(cn.wjybxx.base.function.TriConsumer<? super IContext, ? super T, ? super Throwable> action) ICompletionStage.whenComplete(cn.wjybxx.base.function.TriConsumer<? super IContext, ? super T, ? super Throwable> action, IContext ctx, int options) 该方法返回一个新的Future,无论当前Future执行成功还是失败,给定的操作都将执行,且返回的Future始终以相同的结果进入完成状态。ICompletionStage.whenCompleteAsync(Executor executor, cn.wjybxx.base.function.TriConsumer<? super IContext, ? super T, ? super Throwable> action) ICompletionStage.whenCompleteAsync(Executor executor, cn.wjybxx.base.function.TriConsumer<? super IContext, ? super T, ? super Throwable> action, IContext ctx, int options) 参数类型为ICompletionStage的cn.wjybxx.concurrent中的方法修饰符和类型方法说明FutureCombiner.add(ICompletionStage<?> future) FutureCombiner.addAll(ICompletionStage<?>... futures) static <V> voidFutureUtils.setFuture(IPromise<? super V> output, ICompletionStage<V> input) static <V> voidFutureUtils.setFuture(CompletableFuture<? super V> output, ICompletionStage<V> input) static <V> voidFutureUtils.setFutureAsync(Executor executor, IPromise<? super V> output, ICompletionStage<V> input) static <V> voidFutureUtils.setFutureAsync(Executor executor, IPromise<? super V> output, ICompletionStage<V> input, int options) static <V> voidFutureUtils.setFutureAsync(Executor executor, CompletableFuture<? super V> output, ICompletionStage<V> input) static <V> voidFutureUtils.setFutureAsync(Executor executor, CompletableFuture<? super V> output, ICompletionStage<V> input, int options) static <V> IPromise<V> FutureUtils.toEventLoopPromise(EventLoop eventLoop, ICompletionStage<V> input) static <V> CompletableFuture<V> FutureUtils.toJDKFuture(ICompletionStage<V> stage) 类型变量类型为ICompletionStage的cn.wjybxx.concurrent中的方法参数修饰符和类型方法说明FutureCombiner.addAll(Collection<? extends ICompletionStage<?>> futures) <U> IFuture<U> ForwardFuture.composeApply(BiFunction<? super IContext, ? super V, ? extends ICompletionStage<U>> fn) <U> IFuture<U> ForwardFuture.composeApply(BiFunction<? super IContext, ? super V, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.composeApply(BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeApply(BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn, IContext ctx, int options) 该方法表示在当前Future与返回的Future中插入一个异步操作,构建异步管道 => 这是链式调用的核心API。<U> IFuture<U> IFuture.composeApply(BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn) <U> IFuture<U> IFuture.composeApply(BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> Promise<U> Promise.composeApply(BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn) <U> Promise<U> Promise.composeApply(BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> IFuture<U> ForwardFuture.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super V, ? extends ICompletionStage<U>> fn) <U> IFuture<U> ForwardFuture.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super V, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> IFuture<U> IFuture.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn) <U> IFuture<U> IFuture.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> Promise<U> Promise.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn) <U> Promise<U> Promise.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> IFuture<U> ForwardFuture.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> IFuture<U> ForwardFuture.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> IFuture<U> IFuture.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> IFuture<U> IFuture.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> Promise<U> Promise.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> Promise<U> Promise.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> IFuture<U> ForwardFuture.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> IFuture<U> ForwardFuture.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> IFuture<U> IFuture.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> IFuture<U> IFuture.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> Promise<U> Promise.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> Promise<U> Promise.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) ForwardFuture.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<V>> fallback) ForwardFuture.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<V>> fallback, IContext ctx, int options) <X extends Throwable>
ICompletionStage<T> ICompletionStage.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback) <X extends Throwable>
ICompletionStage<T> ICompletionStage.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback, IContext ctx, int options) 它表示能从从特定的异常中恢复,并异步返回一个正常结果。IFuture.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback) IFuture.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback, IContext ctx, int options) Promise.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback) Promise.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback, IContext ctx, int options) ForwardFuture.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<V>> fallback) ForwardFuture.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<V>> fallback, IContext ctx, int options) <X extends Throwable>
ICompletionStage<T> ICompletionStage.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback) <X extends Throwable>
ICompletionStage<T> ICompletionStage.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback, IContext ctx, int options) IFuture.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback) IFuture.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback, IContext ctx, int options) Promise.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback) Promise.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback, IContext ctx, int options) <U> IFuture<U> ForwardFuture.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super V, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> IFuture<U> ForwardFuture.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super V, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options) 它表示既能接收任务的正常结果,也可以接收任务异常结果,并异步返回一个运算结果。<U> IFuture<U> IFuture.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> IFuture<U> IFuture.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> Promise<U> Promise.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> Promise<U> Promise.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> IFuture<U> ForwardFuture.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super V, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> IFuture<U> ForwardFuture.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super V, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> ICompletionStage<U> ICompletionStage.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> ICompletionStage<U> ICompletionStage.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> IFuture<U> IFuture.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> IFuture<U> IFuture.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> Promise<U> Promise.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> Promise<U> Promise.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options) -
cn.wjybxx.sequential中ICompletionStage的使用
类型变量类型为ICompletionStage的cn.wjybxx.sequential中的方法参数修饰符和类型方法说明<U> UniPromise<U> UniPromise.composeApply(BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn) <U> UniPromise<U> UniPromise.composeApply(BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> UniPromise<U> UniPromise.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn) <U> UniPromise<U> UniPromise.composeApplyAsync(Executor executor, BiFunction<? super IContext, ? super T, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> UniPromise<U> UniPromise.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> UniPromise<U> UniPromise.composeCall(Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> UniPromise<U> UniPromise.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn) <U> UniPromise<U> UniPromise.composeCallAsync(Executor executor, Function<? super IContext, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <X extends Throwable>
UniPromise<T> UniPromise.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback) <X extends Throwable>
UniPromise<T> UniPromise.composeCatching(Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback, IContext ctx, int options) <X extends Throwable>
UniPromise<T> UniPromise.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback) <X extends Throwable>
UniPromise<T> UniPromise.composeCatchingAsync(Executor executor, Class<X> exceptionType, BiFunction<? super IContext, ? super X, ? extends ICompletionStage<T>> fallback, IContext ctx, int options) <U> UniPromise<U> UniPromise.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> UniPromise<U> UniPromise.composeHandle(cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options) <U> UniPromise<U> UniPromise.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn) <U> UniPromise<U> UniPromise.composeHandleAsync(Executor executor, cn.wjybxx.base.function.TriFunction<? super IContext, ? super T, ? super Throwable, ? extends ICompletionStage<U>> fn, IContext ctx, int options)