summaryrefslogtreecommitdiff
path: root/plugins/jobs/plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jobs/plugin.go')
-rw-r--r--plugins/jobs/plugin.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/jobs/plugin.go b/plugins/jobs/plugin.go
index cda2a711..bd5ff5bf 100644
--- a/plugins/jobs/plugin.go
+++ b/plugins/jobs/plugin.go
@@ -2,6 +2,7 @@ package jobs
import (
"context"
+ "fmt"
endure "github.com/spiral/endure/pkg/container"
"github.com/spiral/errors"
@@ -12,6 +13,8 @@ import (
)
const (
+ // RrJobs env variable
+ RrJobs string = "rr_jobs"
PluginName string = "jobs"
)
@@ -24,6 +27,10 @@ type Plugin struct {
consumers map[string]Consumer
}
+func testListener(data interface{}) {
+ fmt.Println(data)
+}
+
func (p *Plugin) Init(cfg config.Configurer, log logger.Logger, server server.Server) error {
const op = errors.Op("jobs_plugin_init")
if !cfg.Has(PluginName) {
@@ -35,7 +42,7 @@ func (p *Plugin) Init(cfg config.Configurer, log logger.Logger, server server.Se
return errors.E(op, err)
}
- p.workersPool, err = server.NewWorkerPool(context.Background(), p.cfg.poolCfg, nil, nil)
+ p.workersPool, err = server.NewWorkerPool(context.Background(), p.cfg.poolCfg, map[string]string{RrJobs: "true"}, testListener)
if err != nil {
return errors.E(op, err)
}