summaryrefslogtreecommitdiff
path: root/interfaces/server/interface.go
diff options
context:
space:
mode:
Diffstat (limited to 'interfaces/server/interface.go')
-rw-r--r--interfaces/server/interface.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/interfaces/server/interface.go b/interfaces/server/interface.go
new file mode 100644
index 00000000..c50848d7
--- /dev/null
+++ b/interfaces/server/interface.go
@@ -0,0 +1,19 @@
+package server
+
+import (
+ "context"
+ "os/exec"
+
+ "github.com/spiral/roadrunner/v2/interfaces/pool"
+ "github.com/spiral/roadrunner/v2/interfaces/worker"
+ poolImpl "github.com/spiral/roadrunner/v2/pkg/pool"
+)
+
+type Env map[string]string
+
+// Server creates workers for the application.
+type Server interface {
+ CmdFactory(env Env) (func() *exec.Cmd, error)
+ NewWorker(ctx context.Context, env Env) (worker.BaseProcess, error)
+ NewWorkerPool(ctx context.Context, opt poolImpl.Config, env Env) (pool.Pool, error)
+}