Package com.facebook.buck.worker
Class WorkerProcess
- java.lang.Object
-
- com.facebook.buck.worker.WorkerProcess
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
@ThreadSafe public class WorkerProcess extends Object implements Closeable
-
-
Constructor Summary
Constructors Constructor Description WorkerProcess(ProcessExecutor executor, ProcessExecutorParams processParams, ProjectFilesystem filesystem, Path stdErr, Path tmpPath)
Worker process is a process that stays alive and receives commands which describe jobs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
ensureLaunchAndHandshake()
boolean
isAlive()
com.google.common.util.concurrent.ListenableFuture<WorkerJobResult>
submitJob(String jobArgs)
-
-
-
Constructor Detail
-
WorkerProcess
public WorkerProcess(ProcessExecutor executor, ProcessExecutorParams processParams, ProjectFilesystem filesystem, Path stdErr, Path tmpPath)
Worker process is a process that stays alive and receives commands which describe jobs. Worker processes may be combined into pools so they can perform different jobs concurrently. It communicates via JSON stream and via files. Submitted job blocks the calling thread until it receives the result back. Worker process must understand the protocol that Buck will use to communicate with it.- Parameters:
executor
- Process executor that will start worker process.processParams
- Arguments for process executor.filesystem
- File system for the worker process.stdErr
- path where stderr of a process is kepttmpPath
- Temp folder.
-
-
Method Detail
-
isAlive
public boolean isAlive()
-
ensureLaunchAndHandshake
public void ensureLaunchAndHandshake() throws IOException
- Throws:
IOException
-
submitJob
public com.google.common.util.concurrent.ListenableFuture<WorkerJobResult> submitJob(String jobArgs) throws IOException
- Throws:
IOException
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-