(l logging.Logger, taskClient inventory.TaskClient, registry TaskRegistry, dep Dep, opts ...Option)
| 66 | ) |
| 67 | |
| 68 | func New(l logging.Logger, taskClient inventory.TaskClient, registry TaskRegistry, dep Dep, opts ...Option) Queue { |
| 69 | o := newDefaultOptions() |
| 70 | for _, opt := range opts { |
| 71 | opt.apply(o) |
| 72 | } |
| 73 | |
| 74 | ctx, cancel := context.WithCancel(context.Background()) |
| 75 | |
| 76 | return &queue{ |
| 77 | routineGroup: newRoutineGroup(), |
| 78 | scheduler: NewFifoScheduler(0, l), |
| 79 | quit: make(chan struct{}), |
| 80 | ready: make(chan struct{}, 1), |
| 81 | metric: &metric{}, |
| 82 | options: o, |
| 83 | logger: l, |
| 84 | registry: registry, |
| 85 | taskClient: taskClient, |
| 86 | dep: dep, |
| 87 | rootCtx: ctx, |
| 88 | cancel: cancel, |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | // Start to enable all worker |
| 93 | func (q *queue) Start() { |
no test coverage detected