summaryrefslogtreecommitdiff
path: root/interfaces
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-16 17:02:23 +0300
committerValery Piashchynski <[email protected]>2020-11-16 17:02:23 +0300
commit41829c62826cf88530545715d0aac897b1b56f6d (patch)
tree4d3a1da3cbfeacec420188b308d17e89872ce9d3 /interfaces
parent57ad958acab2d108be0a35547faf6e7a791cf069 (diff)
parent38f6925db27dd94cfbca873901bf932ed1456906 (diff)
Merge branch 'plugin/metrics' into plugin/http
# Conflicts: # plugins/server/plugin.go
Diffstat (limited to 'interfaces')
-rw-r--r--interfaces/metrics/interface.go2
-rw-r--r--interfaces/server/interface.go17
2 files changed, 18 insertions, 1 deletions
diff --git a/interfaces/metrics/interface.go b/interfaces/metrics/interface.go
index 8207fb51..505c3d7b 100644
--- a/interfaces/metrics/interface.go
+++ b/interfaces/metrics/interface.go
@@ -5,5 +5,5 @@ import (
)
type StatProvider interface {
- MetricsCollector() prometheus.Collector
+ MetricsCollector() []prometheus.Collector
}
diff --git a/interfaces/server/interface.go b/interfaces/server/interface.go
new file mode 100644
index 00000000..51d172cb
--- /dev/null
+++ b/interfaces/server/interface.go
@@ -0,0 +1,17 @@
+package server
+
+import (
+ "context"
+ "os/exec"
+
+ "github.com/spiral/roadrunner/v2"
+)
+
+type Env map[string]string
+
+// WorkerFactory creates workers for the application.
+type WorkerFactory 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)
+}