Documentation ¶
Index ¶
- Constants
- func Example()
- func GetClient() *asynq.Client
- func HandleDispatchPostTask(ctx context.Context, t *asynq.Task) error
- func HandleEmailWelcomeTask(ctx context.Context, t *asynq.Task) error
- func HandlePublishPostTask(ctx context.Context, t *asynq.Task) error
- func NewDispatchPostTask(data DispatchPostPayload) error
- func NewEmailWelcomeTask(userID int) (*asynq.Task, error)
- func NewPublishPostTask(data PublishPostPayload) error
- type Config
- type DispatchPostPayload
- type EmailWelcomePayload
- type PublishPostPayload
Constants ¶
View Source
const ( // queue name QueueCritical = "critical" QueueDefault = "default" QueueLow = "low" )
View Source
const (
// TypeDispatchPost task name
TypeDispatchPost = "dispatch:post"
)
View Source
const (
TypeEmailWelcome = "email:welcome"
)
View Source
const (
// TypePublishPost task name
TypePublishPost = "publish:post"
)
Variables ¶
This section is empty.
Functions ¶
func HandleDispatchPostTask ¶
HandleDispatchPostTask to handle the input task.
func HandlePublishPostTask ¶
HandlePublishPostTask to handle the input task.
func NewDispatchPostTask ¶
func NewDispatchPostTask(data DispatchPostPayload) error
NewDispatchPostTask to create a task.
func NewPublishPostTask ¶
func NewPublishPostTask(data PublishPostPayload) error
NewPublishPostTask to create a task.
Types ¶
type DispatchPostPayload ¶
DispatchPostPayload define data payload
type EmailWelcomePayload ¶
type EmailWelcomePayload struct {
UserID int
}
type PublishPostPayload ¶
type PublishPostPayload struct { PostID int64 `json:"post_id"` AnchorUID int64 `json:"anchor_uid"` }
PublishPostPayload define data payload
Click to show internal directories.
Click to hide internal directories.