接口的使用
cn.wjybxx.concurrent.IRegistration
使用IRegistration的程序包
-
cn.wjybxx.concurrent中IRegistration的使用
修饰符和类型方法说明CancelTokenSource.thenAccept(BiConsumer<? super ICancelToken, Object> action, Object ctx) CancelTokenSource.thenAccept(BiConsumer<? super ICancelToken, Object> action, Object ctx, int options) CancelTokenSource.thenAccept(Consumer<? super ICancelToken> action) CancelTokenSource.thenAccept(Consumer<? super ICancelToken> action, int options) ICancelToken.thenAccept(BiConsumer<? super ICancelToken, Object> action, Object ctx) ICancelToken.thenAccept(BiConsumer<? super ICancelToken, Object> action, Object ctx, int options) ICancelToken.thenAccept(Consumer<? super ICancelToken> action) ICancelToken.thenAccept(Consumer<? super ICancelToken> action, int options) 添加的action将在Context收到取消信号时执行 1.如果已收到取消请求,则给定的action会立即执行。ReadonlyCancelToken.thenAccept(BiConsumer<? super ICancelToken, Object> action, Object ctx) ReadonlyCancelToken.thenAccept(BiConsumer<? super ICancelToken, Object> action, Object ctx, int options) ReadonlyCancelToken.thenAccept(Consumer<? super ICancelToken> action) ReadonlyCancelToken.thenAccept(Consumer<? super ICancelToken> action, int options) CancelTokenSource.thenAcceptAsync(Executor executor, BiConsumer<? super ICancelToken, Object> action, Object ctx) CancelTokenSource.thenAcceptAsync(Executor executor, BiConsumer<? super ICancelToken, Object> action, Object ctx, int options) CancelTokenSource.thenAcceptAsync(Executor executor, Consumer<? super ICancelToken> action) CancelTokenSource.thenAcceptAsync(Executor executor, Consumer<? super ICancelToken> action, int options) ICancelToken.thenAcceptAsync(Executor executor, BiConsumer<? super ICancelToken, Object> action, Object ctx) ICancelToken.thenAcceptAsync(Executor executor, BiConsumer<? super ICancelToken, Object> action, Object ctx, int options) ICancelToken.thenAcceptAsync(Executor executor, Consumer<? super ICancelToken> action) ICancelToken.thenAcceptAsync(Executor executor, Consumer<? super ICancelToken> action, int options) ReadonlyCancelToken.thenAcceptAsync(Executor executor, BiConsumer<? super ICancelToken, Object> action, Object ctx) ReadonlyCancelToken.thenAcceptAsync(Executor executor, BiConsumer<? super ICancelToken, Object> action, Object ctx, int options) ReadonlyCancelToken.thenAcceptAsync(Executor executor, Consumer<? super ICancelToken> action) ReadonlyCancelToken.thenAcceptAsync(Executor executor, Consumer<? super ICancelToken> action, int options) CancelTokenSource.thenNotify(CancelTokenListener action) CancelTokenSource.thenNotify(CancelTokenListener action, int options) ICancelToken.thenNotify(CancelTokenListener action) ICancelToken.thenNotify(CancelTokenListener action, int options) 添加一个特定类型的监听器 (用于特殊需求时避免额外的闭包 - task经常需要监听取消令牌)ReadonlyCancelToken.thenNotify(CancelTokenListener action) ReadonlyCancelToken.thenNotify(CancelTokenListener action, int options) CancelTokenSource.thenNotifyAsync(Executor executor, CancelTokenListener action) CancelTokenSource.thenNotifyAsync(Executor executor, CancelTokenListener action, int options) ICancelToken.thenNotifyAsync(Executor executor, CancelTokenListener action) ICancelToken.thenNotifyAsync(Executor executor, CancelTokenListener action, int options) ReadonlyCancelToken.thenNotifyAsync(Executor executor, CancelTokenListener action) ReadonlyCancelToken.thenNotifyAsync(Executor executor, CancelTokenListener action, int options) CancelTokenSource.thenRunAsync(Executor executor, Runnable action) CancelTokenSource.thenRunAsync(Executor executor, Runnable action, int options) CancelTokenSource.thenRunAsync(Executor executor, Consumer<Object> action, Object ctx) CancelTokenSource.thenRunAsync(Executor executor, Consumer<Object> action, Object ctx, int options) ICancelToken.thenRunAsync(Executor executor, Runnable action) ICancelToken.thenRunAsync(Executor executor, Runnable action, int options) ICancelToken.thenRunAsync(Executor executor, Consumer<Object> action, Object ctx) ICancelToken.thenRunAsync(Executor executor, Consumer<Object> action, Object ctx, int options) ReadonlyCancelToken.thenRunAsync(Executor executor, Runnable action) ReadonlyCancelToken.thenRunAsync(Executor executor, Runnable action, int options) ReadonlyCancelToken.thenRunAsync(Executor executor, Consumer<Object> action, Object ctx) ReadonlyCancelToken.thenRunAsync(Executor executor, Consumer<Object> action, Object ctx, int options) CancelTokenSource.thenTransferTo(ICancelTokenSource child) CancelTokenSource.thenTransferTo(ICancelTokenSource child, int options) ICancelToken.thenTransferTo(ICancelTokenSource child) ICancelToken.thenTransferTo(ICancelTokenSource child, int options) 该接口用于方便构建子上下文 1.子token会在当前token进入取消状态时被取消 2.该接口本质是一个快捷方法,但允许子类优化ReadonlyCancelToken.thenTransferTo(ICancelTokenSource child) ReadonlyCancelToken.thenTransferTo(ICancelTokenSource child, int options) CancelTokenSource.thenTransferToAsync(Executor executor, ICancelTokenSource child) CancelTokenSource.thenTransferToAsync(Executor executor, ICancelTokenSource child, int options) ICancelToken.thenTransferToAsync(Executor executor, ICancelTokenSource child) ICancelToken.thenTransferToAsync(Executor executor, ICancelTokenSource child, int options) ReadonlyCancelToken.thenTransferToAsync(Executor executor, ICancelTokenSource child) ReadonlyCancelToken.thenTransferToAsync(Executor executor, ICancelTokenSource child, int options) -
cn.wjybxx.sequential中IRegistration的使用
修饰符和类型方法说明UniCancelTokenSource.thenAccept(BiConsumer<? super ICancelToken, Object> action, Object ctx) UniCancelTokenSource.thenAccept(BiConsumer<? super ICancelToken, Object> action, Object ctx, int options) UniCancelTokenSource.thenAccept(Consumer<? super ICancelToken> action) UniCancelTokenSource.thenAccept(Consumer<? super ICancelToken> action, int options) UniCancelTokenSource.thenAcceptAsync(Executor executor, BiConsumer<? super ICancelToken, Object> action, Object ctx) UniCancelTokenSource.thenAcceptAsync(Executor executor, BiConsumer<? super ICancelToken, Object> action, Object ctx, int options) UniCancelTokenSource.thenAcceptAsync(Executor executor, Consumer<? super ICancelToken> action) UniCancelTokenSource.thenAcceptAsync(Executor executor, Consumer<? super ICancelToken> action, int options) UniCancelTokenSource.thenNotify(CancelTokenListener action) UniCancelTokenSource.thenNotify(CancelTokenListener action, int options) UniCancelTokenSource.thenNotifyAsync(Executor executor, CancelTokenListener action) UniCancelTokenSource.thenNotifyAsync(Executor executor, CancelTokenListener action, int options) UniCancelTokenSource.thenRunAsync(Executor executor, Runnable action) UniCancelTokenSource.thenRunAsync(Executor executor, Runnable action, int options) UniCancelTokenSource.thenRunAsync(Executor executor, Consumer<Object> action, Object ctx) UniCancelTokenSource.thenRunAsync(Executor executor, Consumer<Object> action, Object ctx, int options) UniCancelTokenSource.thenTransferTo(ICancelTokenSource child) UniCancelTokenSource.thenTransferTo(ICancelTokenSource child, int options) UniCancelTokenSource.thenTransferToAsync(Executor executor, ICancelTokenSource child) UniCancelTokenSource.thenTransferToAsync(Executor executor, ICancelTokenSource child, int options)