summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/http/handler.go6
-rw-r--r--plugins/server/interface.go4
-rw-r--r--plugins/server/plugin.go8
3 files changed, 9 insertions, 9 deletions
diff --git a/plugins/http/handler.go b/plugins/http/handler.go
index 1889ed6d..15954f96 100644
--- a/plugins/http/handler.go
+++ b/plugins/http/handler.go
@@ -26,7 +26,7 @@ const (
const MB = 1024 * 1024
type Handle interface {
- AddListener(l events.EventListener)
+ AddListener(l events.Listener)
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
@@ -75,7 +75,7 @@ type handler struct {
log logger.Logger
pool pool.Pool
mul sync.Mutex
- lsn events.EventListener
+ lsn events.Listener
}
func NewHandler(maxReqSize uint64, uploads UploadsConfig, trusted Cidrs, pool pool.Pool) (Handle, error) {
@@ -91,7 +91,7 @@ func NewHandler(maxReqSize uint64, uploads UploadsConfig, trusted Cidrs, pool po
}
// Listen attaches handler event controller.
-func (h *handler) AddListener(l events.EventListener) {
+func (h *handler) AddListener(l events.Listener) {
h.mul.Lock()
defer h.mul.Unlock()
diff --git a/plugins/server/interface.go b/plugins/server/interface.go
index 9c1079ea..98345694 100644
--- a/plugins/server/interface.go
+++ b/plugins/server/interface.go
@@ -15,6 +15,6 @@ 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, listeners ...events.EventListener) (worker.BaseProcess, error)
- NewWorkerPool(ctx context.Context, opt poolImpl.Config, env Env, listeners ...events.EventListener) (pool.Pool, error)
+ NewWorker(ctx context.Context, env Env, listeners ...events.Listener) (worker.BaseProcess, error)
+ NewWorkerPool(ctx context.Context, opt poolImpl.Config, env Env, listeners ...events.Listener) (pool.Pool, error)
}
diff --git a/plugins/server/plugin.go b/plugins/server/plugin.go
index b280d253..5b023bc6 100644
--- a/plugins/server/plugin.go
+++ b/plugins/server/plugin.go
@@ -104,10 +104,10 @@ func (server *Plugin) CmdFactory(env Env) (func() *exec.Cmd, error) {
}
// NewWorker issues new standalone worker.
-func (server *Plugin) NewWorker(ctx context.Context, env Env, listeners ...events.EventListener) (worker.BaseProcess, error) {
+func (server *Plugin) NewWorker(ctx context.Context, env Env, listeners ...events.Listener) (worker.BaseProcess, error) {
const op = errors.Op("new worker")
- list := make([]events.EventListener, 0, len(listeners))
+ list := make([]events.Listener, 0, len(listeners))
list = append(list, server.collectWorkerLogs)
spawnCmd, err := server.CmdFactory(env)
@@ -124,14 +124,14 @@ func (server *Plugin) NewWorker(ctx context.Context, env Env, listeners ...event
}
// NewWorkerPool issues new worker pool.
-func (server *Plugin) NewWorkerPool(ctx context.Context, opt poolImpl.Config, env Env, listeners ...events.EventListener) (pool.Pool, error) {
+func (server *Plugin) NewWorkerPool(ctx context.Context, opt poolImpl.Config, env Env, listeners ...events.Listener) (pool.Pool, error) {
const op = errors.Op("server plugins new worker pool")
spawnCmd, err := server.CmdFactory(env)
if err != nil {
return nil, errors.E(op, err)
}
- list := make([]events.EventListener, 0, len(listeners))
+ list := make([]events.Listener, 0, len(listeners))
list = append(list, server.collectPoolLogs)
p, err := poolImpl.Initialize(ctx, spawnCmd, server.factory, opt, poolImpl.AddListeners(list...))