summaryrefslogtreecommitdiff
path: root/ipc/interface.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2022-01-12 00:19:48 +0300
committerValery Piashchynski <[email protected]>2022-01-12 00:19:48 +0300
commit215c7c91937bf65704db18a59a327a3c64e43530 (patch)
tree85d2b32ddf7230064e620bb59f76ef4bfd6b24cf /ipc/interface.go
parent7b5d220f0f1be155d83d887cd4996bdf4394c570 (diff)
pass logger from the factory
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'ipc/interface.go')
-rw-r--r--ipc/interface.go20
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
+}