chore: support custom parameter in queue (#608)

* chore: support custom parameter in queue

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2021-07-24 01:29:47 +08:00
committed by GitHub
parent 66923789ff
commit ce6e87639a
5 changed files with 66 additions and 10 deletions

View File

@@ -60,7 +60,11 @@ func TestCustomFuncAndWait(t *testing.T) {
return nil
}),
)
q := queue.NewQueue(w, 2)
q, err := queue.NewQueue(
queue.WithWorker(w),
queue.WithWorkerCount(2),
)
assert.NoError(t, err)
q.Start()
time.Sleep(100 * time.Millisecond)
q.Queue(m)