Update Client.Enqueue to return TaskInfo

This commit is contained in:
Ken Hibino
2021-05-15 06:43:18 -07:00
parent 09cbea66f6
commit b835090ad8
6 changed files with 212 additions and 173 deletions

4
doc.go
View File

@@ -29,10 +29,10 @@ The Client is used to enqueue a task.
task := asynq.NewTask("example", b)
// Enqueue the task to be processed immediately.
res, err := client.Enqueue(task)
info, err := client.Enqueue(task)
// Schedule the task to be processed after one minute.
res, err = client.Enqueue(t, asynq.ProcessIn(1*time.Minute))
info, err = client.Enqueue(t, asynq.ProcessIn(1*time.Minute))
The Server is used to run the task processing workers with a given
handler.