Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vmihailenco/taskq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3
Choose a base ref
...
head repository: sundeck-io/taskq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 27, 2024

  1. Copy the full SHA
    dde6a3f View commit details
Showing with 8 additions and 2 deletions.
  1. +8 −2 memqueue/queue.go
10 changes: 8 additions & 2 deletions memqueue/queue.go
Original file line number Diff line number Diff line change
@@ -88,15 +88,21 @@ type Queue struct {
var _ taskq.Queue = (*Queue)(nil)

func NewQueue(opt *taskq.QueueOptions) *Queue {
return NewQueueMaybeConsumer(true, opt)
}

func NewQueueMaybeConsumer(startConsumer bool, opt *taskq.QueueOptions) *Queue {
opt.Init()

q := &Queue{
opt: opt,
}

q.consumer = taskq.NewConsumer(q)
if err := q.consumer.Start(context.Background()); err != nil {
panic(err)
if startConsumer {
if err := q.consumer.Start(context.Background()); err != nil {
panic(err)
}
}

return q