Package aQute.libg.forker
Class Forker<T>
java.lang.Object
aQute.libg.forker.Forker<T>
- Type Parameters:
T
-
A Forker is good in parallel scheduling tasks with dependencies. You can add
tasks with
doWhen(Collection, Object, Runnable)
. The collection is
the list of dependencies, the object is the target, and the runnable is run
to update the target. The runnable will only run when all its dependencies
have ran their associated runnable.- Author:
- aqute
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Forker
Constructor- Parameters:
executor
-
-
Forker
public Forker()Constructor
-
-
Method Details
-
doWhen
Schedule a job for execution when the dependencies are done of target are done.- Parameters:
dependencies
- the dependencies that must have runtarget
- the target, is removed from all the dependencies when it ranrunnable
- the runnable to run
-
start
- Throws:
InterruptedException
-
sync
- Throws:
InterruptedException
-
cancel
Cancel the forker.- Throws:
InterruptedException
-
getCount
public int getCount()
-