@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 WorkerProcessPool
InterruptedException
public WorkerProcessPoolSync.BorrowedWorkerProcess borrowWorkerProcess() throws InterruptedException
WorkerProcessPoolSync.BorrowedWorkerProcess.close()
after using them.InterruptedException
public void close()
close
in interface WorkerProcessPool
close
in interface Closeable
close
in interface AutoCloseable
public int getCapacity()
getCapacity
in interface WorkerProcessPool
public com.google.common.hash.HashCode getPoolHash()
getPoolHash
in interface WorkerProcessPool