We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2956d04 commit baf5fafCopy full SHA for baf5faf
memqueue/queue.go
@@ -88,15 +88,21 @@ type Queue struct {
88
var _ taskq.Queue = (*Queue)(nil)
89
90
func NewQueue(opt *taskq.QueueOptions) *Queue {
91
+ return NewQueueMaybeConsumer(true, opt)
92
+}
93
+
94
+func NewQueueMaybeConsumer(startConsumer bool, opt *taskq.QueueOptions) *Queue {
95
opt.Init()
96
97
q := &Queue{
98
opt: opt,
99
}
100
101
q.consumer = taskq.NewConsumer(q)
- if err := q.consumer.Start(context.Background()); err != nil {
- panic(err)
102
+ if startConsumer {
103
+ if err := q.consumer.Start(context.Background()); err != nil {
104
+ panic(err)
105
+ }
106
107
108
return q
0 commit comments