public class ThreadedWorkerManager extends Object implements WorkerManager
Constructor and Description |
---|
ThreadedWorkerManager(ExecutorService executor)
Constructs a threaded worker manager with a specified executor.
|
ThreadedWorkerManager(int numThreads)
Constructs a fix thread worker with a specified number of threads.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Worker |
getWorker()
Get the result collector in use.
|
void |
interruptAndClose()
Interrupt a thread and then close it.
|
public ThreadedWorkerManager(int numThreads)
numThreads
- Number of threadspublic ThreadedWorkerManager(ExecutorService executor)
executor
- An executor servicepublic final Worker getWorker()
WorkerManager
getWorker
in interface WorkerManager
public final void interruptAndClose()
Interruptible
interruptAndClose
in interface Interruptible
public final void close()
close
in interface AutoCloseable
Copyright © 2019. All rights reserved.