summaryrefslogtreecommitdiff
path: root/transport/interface.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-09-16 17:12:37 +0300
committerValery Piashchynski <[email protected]>2021-09-16 17:12:37 +0300
commitf3491c089b4da77fd8d2bc942a88b6b8d117a8a5 (patch)
tree32bfffb1f24eeee7b909747cc00a6a6b9fd3ee83 /transport/interface.go
parent5d2cd55ab522d4f1e65a833f91146444465a32ac (diff)
Move plugins to a separate repository
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'transport/interface.go')
-rw-r--r--transport/interface.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/transport/interface.go b/transport/interface.go
new file mode 100644
index 00000000..e20f2b0b
--- /dev/null
+++ b/transport/interface.go
@@ -0,0 +1,21 @@
+package transport
+
+import (
+ "context"
+ "os/exec"
+
+ "github.com/spiral/roadrunner/v2/events"
+ "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, ...events.Listener) (*worker.Process, error)
+ // SpawnWorker creates new WorkerProcess process based on given command.
+ // Process must not be started.
+ SpawnWorker(*exec.Cmd, ...events.Listener) (*worker.Process, error)
+ // Close the factory and underlying connections.
+ Close() error
+}