Package com.alibaba.ttl
Class TtlRecursiveTask<V>
- java.lang.Object
-
- java.util.concurrent.ForkJoinTask<V>
-
- com.alibaba.ttl.TtlRecursiveTask<V>
-
- All Implemented Interfaces:
TtlEnhanced,Serializable,Future<V>
public abstract class TtlRecursiveTask<V> extends ForkJoinTask<V> implements TtlEnhanced
A recursive result-bearingForkJoinTaskenhanced byTransmittableThreadLocal.Recommend to use
TtlAgent; Specially forJava 8StreamandCompletableFuture, these async task are executed byForkJoinPoolviaForkJoinTaskat the bottom.- Since:
- 2.4.0
- Author:
- LNAmp
- See Also:
RecursiveTask,TtlForkJoinPoolHelper,TtlAgent, Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTtlRecursiveTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Vcompute()The main computation performed by this task.protected booleanexec()Implements execution conventions for RecursiveTask.VgetRawResult()protected voidsetRawResult(V value)-
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
-
-
-
-
Method Detail
-
compute
protected abstract V compute()
The main computation performed by this task.- Returns:
- the result of the computation
-
getRawResult
public final V getRawResult()
- Specified by:
getRawResultin classForkJoinTask<V>
-
setRawResult
protected final void setRawResult(V value)
- Specified by:
setRawResultin classForkJoinTask<V>
-
exec
protected final boolean exec()
Implements execution conventions for RecursiveTask.- Specified by:
execin classForkJoinTask<V>
-
-