//----------------------------------------------
// Write a function NewXXXTask to create a task.
// A task consists of a type and a payload.
//----------------------------------------------
Write a function NewXXXTask to create a task.
A task consists of a type and a payload.
// ---------------------------------------------- // Write a function NewXXXTask to create a task . // A task consists of a type and a payload . // ----------------------------------------------
func NewEmailWelcomeTask(userID int) (*asynq.Task, error) {
	payload, err := json.Marshal(EmailWelcomePayload{UserID: userID})
	if err != nil {
		return nil, err
	}
	return asynq.NewTask(TypeEmailWelcome, payload), nil
}
func NewEmailWelcomeTask ( userID int ) ( * asynq . Task , error ) { payload , err := json . Marshal ( EmailWelcomePayload { UserID : userID } ) if err != nil { return nil , err } return asynq . NewTask ( TypeEmailWelcome , payload ) , nil }
Write a function NewXXXTask to create a task.
Write a function NewXXXTask to create a task .