queue

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client queue client.

func (*Client) Enqueue

func (q *Client) Enqueue(taskType string, payload []byte, opts ...asynq.Option) (*asynq.TaskInfo, error)

Enqueue enqueues the given task and payload to a queue.

func (*Client) RegisterHandler

func (q *Client) RegisterHandler(taskType string, handler asynq.Handler) error

RegisterHandler register handler for the task type.

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

Queue is Queue instance.

func New

func New(opt redis.Options) *Queue

New returns a Queue instance.

func (*Queue) Client

func (q *Queue) Client() *Client

Client returns the queue client.

func (*Queue) Run

func (q *Queue) Run()

Run tasks with handlers. Special attention, please run after registration is completed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL