queue

package
v0.0.0-...-2c789bf Latest Latest
Warning

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

Go to latest
Published: Feb 7, 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 ...

func NewClient

func NewClient(redisAddress string) *Client

NewClient ...

func (*Client) Add

func (c *Client) Add(task *asynq.Task, opts ...asynq.Option) *Client

Add a new task to queue

type Handler

type Handler struct {
	Pattern string
	FN      asynq.Handler
}

Handler ...

type HandlerFunc

type HandlerFunc struct {
	Pattern string
	FN      func(context.Context, *asynq.Task) error
}

HandlerFunc ...

type Queue

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

Queue holds Asynq server things

func CreateServer

func CreateServer(redisAddress string, concurrency int, qs Queues) *Queue

CreateServer creates a new Asynq server

func (*Queue) AddHandler

func (q *Queue) AddHandler(pattern string, handler asynq.Handler) *Queue

AddHandler adds a handler to mux

func (*Queue) AddHandlerFunc

func (q *Queue) AddHandlerFunc(pattern string, handler func(context.Context, *asynq.Task) error) *Queue

AddHandlerFunc adds a handler func to mux

func (*Queue) MountMonitor

func (q *Queue) MountMonitor(redisAddress, redisPw string) (*Queue, *asynqmon.HTTPHandler)

MountMonitor mounts asynqmon

func (*Queue) Run

func (q *Queue) Run()

type Queues

type Queues map[string]int

Queues represents queues config for Asynq

Jump to

Keyboard shortcuts

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