asynq

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package asynq profiles Asynq enqueue and worker execution operations while keeping Asynq and Redis dependencies outside the webpprof core module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(configs ...Config) asynq.MiddlewareFunc

Middleware profiles worker execution. Register it with ServeMux.Use.

func MiddlewareWith

func MiddlewareWith(p *webpprof.Profiler, configs ...Config) asynq.MiddlewareFunc

MiddlewareWith profiles worker execution with p.

Types

type Client

type Client interface {
	Enqueue(*asynq.Task, ...asynq.Option) (*asynq.TaskInfo, error)
	EnqueueContext(context.Context, *asynq.Task, ...asynq.Option) (*asynq.TaskInfo, error)
}

Client is the subset of asynq.Client wrapped by Profile. Keep the original *asynq.Client to call Close; ownership is not transferred to this wrapper.

func Profile

func Profile(client Client, configs ...Config) Client

Profile wraps client with the default profiler.

func ProfileWith

func ProfileWith(p *webpprof.Profiler, client Client, configs ...Config) Client

ProfileWith wraps client with p.

type Config

type Config struct {
	Connection     string
	CapturePayload bool
	PayloadLimit   int
}

Config controls Asynq event metadata. Payload capture is disabled by default because queue payloads commonly contain credentials or personal data.

Jump to

Keyboard shortcuts

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