diff options
Diffstat (limited to 'ipc/interface.go')
-rw-r--r-- | ipc/interface.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ipc/interface.go b/ipc/interface.go new file mode 100644 index 00000000..1d70cd21 --- /dev/null +++ b/ipc/interface.go @@ -0,0 +1,20 @@ +package ipc + +import ( + "context" + "os/exec" + + "github.com/spiral/roadrunner/v2/worker" +) + +// Factory is responsible for wrapping given command into tasks WorkerProcess. +type Factory interface { + // SpawnWorkerWithTimeout creates new WorkerProcess process based on given command with context. + // Process must not be started. + SpawnWorkerWithTimeout(context.Context, *exec.Cmd) (*worker.Process, error) + // SpawnWorker creates new WorkerProcess process based on given command. + // Process must not be started. + SpawnWorker(*exec.Cmd) (*worker.Process, error) + // Close the factory and underlying connections. + Close() error +} |