Package com.alibaba.ttl
Class TtlRecursiveAction
- All Implemented Interfaces:
TtlEnhanced
,Serializable
,Future<Void>
A recursive resultless
ForkJoinTask
enhanced by TransmittableThreadLocal
.
Recommend to use TtlAgent
;
Specially for Java 8
Stream
and CompletableFuture
,
these async task are executed by ForkJoinPool
via ForkJoinTask
at the bottom.
- Since:
- 2.4.0
- Author:
- LNAmp
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
compute()
The main computation performed by this task.protected final boolean
exec()
Implements execution conventions for RecursiveActions.final Void
protected final void
setRawResult
(Void mustBeNull) Methods inherited from class java.util.concurrent.ForkJoinTask
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, complete, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollSubmission, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnfork
-
Constructor Details
-
TtlRecursiveAction
protected TtlRecursiveAction()
-
-
Method Details
-
compute
protected abstract void compute()The main computation performed by this task. -
getRawResult
- Specified by:
getRawResult
in classForkJoinTask<Void>
-
setRawResult
- Specified by:
setRawResult
in classForkJoinTask<Void>
-
exec
protected final boolean exec()Implements execution conventions for RecursiveActions.- Specified by:
exec
in classForkJoinTask<Void>
-