@ThreadSafe public class WorkerProcessPoolSync extends Object implements Closeable, WorkerProcessPool
WorkerProcess instances.| Modifier and Type | Class and Description |
|---|---|
static class |
WorkerProcessPoolSync.BorrowedWorkerProcess
Represents a
WorkerProcess borrowed from a WorkerProcessPoolSync. |
| Constructor and Description |
|---|
WorkerProcessPoolSync(int maxWorkers,
com.google.common.hash.HashCode poolHash,
ThrowingSupplier<WorkerProcess,IOException> startWorkerProcess) |
| Modifier and Type | Method and Description |
|---|---|
WorkerProcessPoolSync.BorrowedWorkerProcess |
borrowWorkerProcess()
If there are available workers, returns one.
|
void |
close() |
int |
getCapacity() |
com.google.common.hash.HashCode |
getPoolHash() |
com.google.common.util.concurrent.ListenableFuture<WorkerJobResult> |
submitJob(String expandedJobArgs) |
public WorkerProcessPoolSync(int maxWorkers,
com.google.common.hash.HashCode poolHash,
ThrowingSupplier<WorkerProcess,IOException> startWorkerProcess)
public com.google.common.util.concurrent.ListenableFuture<WorkerJobResult> submitJob(String expandedJobArgs) throws InterruptedException
submitJob in interface WorkerProcessPoolInterruptedExceptionpublic WorkerProcessPoolSync.BorrowedWorkerProcess borrowWorkerProcess() throws InterruptedException
WorkerProcessPoolSync.BorrowedWorkerProcess.close() after using them.InterruptedExceptionpublic void close()
close in interface WorkerProcessPoolclose in interface Closeableclose in interface AutoCloseablepublic int getCapacity()
getCapacity in interface WorkerProcessPoolpublic com.google.common.hash.HashCode getPoolHash()
getPoolHash in interface WorkerProcessPool