mirror of
https://github.com/hibiken/asynq.git
synced 2025-09-19 05:17:30 +08:00
Make Task type immutable
This change makes it impossible to mutate payload within Handler or RetryDelayFunc.
This commit is contained in:
9
doc.go
9
doc.go
@@ -9,12 +9,11 @@ The Client is used to register a task to be processed at the specified time.
|
||||
|
||||
client := asynq.NewClient(redis)
|
||||
|
||||
t := asynq.Task{
|
||||
Type: "send_email",
|
||||
Payload: map[string]interface{}{"user_id": 42},
|
||||
}
|
||||
t := asynq.NewTask(
|
||||
"send_email",
|
||||
map[string]interface{}{"user_id": 42})
|
||||
|
||||
err := client.Schedule(&t, time.Now().Add(time.Minute))
|
||||
err := client.Schedule(t, time.Now().Add(time.Minute))
|
||||
|
||||
The Background is used to run the background task processing with a given
|
||||
handler.
|
||||
|
Reference in New Issue
Block a user