- 所有超级接口:
ICancelToken
取消令牌源由任务的创建者(发起者)持有,具备取消权限。
- 作者:
- wjybxx date - 2024/1/8
-
字段概要
从接口继承的字段 cn.wjybxx.base.concurrent.ICancelToken
NONE -
方法概要
修饰符和类型方法说明default booleancancel()使用默认原因取消booleancancel(int cancelCode) 将Token置为取消状态default ICancelTokenSourcenewInstance(boolean copyCode) 创建一个同类型实例。从接口继承的方法 cn.wjybxx.base.concurrent.ICancelToken
canBeCancelled, cancelCode, checkCancel, isCancelRequested, reason, thenAccept, thenAccept, thenAccept, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptAsync, thenAcceptAsync, thenNotify, thenNotify, thenNotifyAsync, thenNotifyAsync, thenRun, thenRun, thenRun, thenRun, thenRunAsync, thenRunAsync, thenRunAsync, thenRunAsync, thenTransferTo, thenTransferTo, thenTransferToAsync, thenTransferToAsync
-
方法详细资料
-
cancel
boolean cancel(int cancelCode) 将Token置为取消状态- 参数:
cancelCode- 取消码;reason部分需大于0;辅助类CancelCodeBuilder- 返回:
- 成功使用给定取消码进入取消状态则返回true,否则返回false
- 抛出:
IllegalArgumentException- 如果code小于等于0;或reason部分为0
-
cancel
default boolean cancel()使用默认原因取消 -
newInstance
创建一个同类型实例。 1.原型对象,避免具体类型依赖。 2.默认情况下,其它上下文应当拷贝。- 参数:
copyCode- 是否拷贝当前取消码- 返回:
- 取消令牌
-
newInstance
-