summaryrefslogtreecommitdiff
path: root/common/jobs/interface.go
blob: f90c9c21ecd3eb878176f8e9e20267c79c88d7aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package jobs

import (
	"github.com/spiral/roadrunner/v2/pkg/events"
	priorityqueue "github.com/spiral/roadrunner/v2/pkg/priority_queue"
	"github.com/spiral/roadrunner/v2/plugins/jobs/job"
	"github.com/spiral/roadrunner/v2/plugins/jobs/pipeline"
)

// Consumer todo naming
type Consumer interface {
	Push(job *job.Job) error
	Register(pipeline *pipeline.Pipeline) error
	Run(pipeline *pipeline.Pipeline) error
	Stop() error

	Pause(pipeline string)
	Resume(pipeline string)
}

type Constructor interface {
	JobsConstruct(configKey string, e events.Handler, queue priorityqueue.Queue) (Consumer, error)
	FromPipeline(pipe *pipeline.Pipeline, e events.Handler, queue priorityqueue.Queue) (Consumer, error)
}