summaryrefslogtreecommitdiff
path: root/interfaces
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-18 10:37:44 +0300
committerValery Piashchynski <[email protected]>2020-11-18 10:37:44 +0300
commitbe18313f6bf8f903f2d2ba3ca812ad8546c329f6 (patch)
tree0a6d7382a526a59a034f85d60b3f2b24e103ffcd /interfaces
parent6236aac37bd1661b20400689f66d1e92283c5111 (diff)
Informer plugin ready
Diffstat (limited to 'interfaces')
-rw-r--r--interfaces/informer/interface.go7
-rw-r--r--interfaces/server/interface.go4
2 files changed, 9 insertions, 2 deletions
diff --git a/interfaces/informer/interface.go b/interfaces/informer/interface.go
new file mode 100644
index 00000000..42e82338
--- /dev/null
+++ b/interfaces/informer/interface.go
@@ -0,0 +1,7 @@
+package informer
+
+import "github.com/spiral/roadrunner/v2"
+
+type Informer interface {
+ Workers() []roadrunner.WorkerBase
+}
diff --git a/interfaces/server/interface.go b/interfaces/server/interface.go
index 51d172cb..2dae30c5 100644
--- a/interfaces/server/interface.go
+++ b/interfaces/server/interface.go
@@ -9,8 +9,8 @@ import (
type Env map[string]string
-// WorkerFactory creates workers for the application.
-type WorkerFactory interface {
+// Server creates workers for the application.
+type Server interface {
CmdFactory(env Env) (func() *exec.Cmd, error)
NewWorker(ctx context.Context, env Env) (roadrunner.WorkerBase, error)
NewWorkerPool(ctx context.Context, opt roadrunner.PoolConfig, env Env) (roadrunner.Pool, error)