Package de.hsh.graja.regression
Class WorkerPool
java.lang.Object
de.hsh.graja.regression.WorkerPool
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
doRun
(Logging log, Iterable<? extends WorkerPool.Worker> initialWorkers, WorkerPool.Consumer consumer) void
enqueue
(WorkerPool.Worker worker, WorkerPool.Consumer consumer) void
boolean
suspendMeIf
(Supplier<Boolean> check) Suspends the current thread, if the check is true.
-
Constructor Details
-
WorkerPool
public WorkerPool(int maxConcurrentTasks)
-
-
Method Details
-
enqueue
-
doRun
public void doRun(Logging log, Iterable<? extends WorkerPool.Worker> initialWorkers, WorkerPool.Consumer consumer) throws Exception - Throws:
Exception
-
suspendMeIf
Suspends the current thread, if the check is true. This method returns after some other thread has called resume for this thread.- Parameters:
check
- The check is executed non-concurrent when no other pooled thread is executing- Returns:
- true, if the thread was suspended.
-
resume
-