Documentation ¶
Index ¶
- type FailJob
- type Processor
- type Queue
- type RQ
- func (q *RQ) Ack(ctx context.Context, id string) error
- func (q *RQ) Add(ctx context.Context, id string, body []byte, delay time.Duration) error
- func (q *RQ) Fail(ctx context.Context, id, msg string) error
- func (q *RQ) FetchDelay(ctx context.Context) error
- func (q *RQ) Pop(ctx context.Context) (string, []byte, error)
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FailJob ¶
type FailJob struct { Id string `json:"id"` Msg string `json:"msg"` Try int `json:"try"` Body json.RawMessage `json:"body"` }
type Queue ¶
type Queue interface { //添加任务 Add(ctx context.Context, id string, body []byte, delay time.Duration) error //拉取任务 Pop(ctx context.Context) (string, []byte, error) //确认任务 Ack(ctx context.Context, id string) error //失败任务 Fail(ctx context.Context, id, msg string) error //检查延迟任务 FetchDelay(ctx context.Context) error }
Click to show internal directories.
Click to hide internal directories.