Update docs with new APIs

This commit is contained in:
Ken Hibino
2020-04-12 17:16:44 -07:00
parent b086e88a47
commit 24da281aa7
3 changed files with 16 additions and 7 deletions

6
doc.go
View File

@@ -30,13 +30,13 @@ Task is created with two parameters: its type and payload.
// Schedule the task to be processed in one minute.
err = client.EnqueueIn(time.Minute, t)
The Background is used to run the background task processing with a given
The Server is used to run the background task processing with a given
handler.
bg := asynq.NewBackground(redis, &asynq.Config{
srv := asynq.NewServer(redis, asynq.Config{
Concurrency: 10,
})
bg.Run(handler)
srv.Run(handler)
Handler is an interface with one method ProcessTask which
takes a task and returns an error. Handler should return nil if