summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-07-27 12:39:01 +0300
committerValery Piashchynski <[email protected]>2021-07-27 12:39:01 +0300
commit1e59ec2755a9cdafd26864ba532fa4d3eff46ecd (patch)
tree68c7c7e8d9f4d99debc4895ab8469e323c60f47b /common
parentd72181126867c7e8fc05e5ac927bd90d01e0dbc7 (diff)
Initial support for the cancellation via context
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'common')
-rw-r--r--common/jobs/interface.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/common/jobs/interface.go b/common/jobs/interface.go
index f90c9c21..c957df2b 100644
--- a/common/jobs/interface.go
+++ b/common/jobs/interface.go
@@ -1,6 +1,8 @@
package jobs
import (
+ "context"
+
"github.com/spiral/roadrunner/v2/pkg/events"
priorityqueue "github.com/spiral/roadrunner/v2/pkg/priority_queue"
"github.com/spiral/roadrunner/v2/plugins/jobs/job"
@@ -9,13 +11,13 @@ import (
// Consumer todo naming
type Consumer interface {
- Push(job *job.Job) error
- Register(pipeline *pipeline.Pipeline) error
- Run(pipeline *pipeline.Pipeline) error
- Stop() error
+ Push(ctx context.Context, job *job.Job) error
+ Register(ctx context.Context, pipeline *pipeline.Pipeline) error
+ Run(ctx context.Context, pipeline *pipeline.Pipeline) error
+ Stop(ctx context.Context) error
- Pause(pipeline string)
- Resume(pipeline string)
+ Pause(ctx context.Context, pipeline string)
+ Resume(ctx context.Context, pipeline string)
}
type Constructor interface {