goqueue

package module
v0.3.2 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 goqueue instruments github.com/levskiy0/go-queue dispatches, job execution, and queue statistics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job = queuecontract.Job

Job aliases the go-queue job contract wrapped during execution.

func ProfileJobs

func ProfileJobs(jobs []Job, queue string) []Job

ProfileJobs instruments jobs with the default profiler.

func ProfileJobsWith

func ProfileJobsWith(profiler *webpprof.Profiler, jobs []Job, queue string) []Job

ProfileJobsWith instruments jobs with an explicit profiler.

type ProfilerGoQueue

type ProfilerGoQueue struct {
	DefaultQueue string
}

ProfilerGoQueue implements webpprof.Integration for queue instances.

func New

func New(names ...string) ProfilerGoQueue

New creates a queue integration. The first non-empty name becomes the default queue label and defaults to "default".

func (ProfilerGoQueue) Name

func (ProfilerGoQueue) Name() string

Name returns the queue integration cache namespace.

func (ProfilerGoQueue) Profile

func (d ProfilerGoQueue) Profile(scope webpprof.Scope, queue Queue) Queue

Profile wraps queue dispatch and registration operations and registers queue statistics when the underlying value supports them.

type ProfilerJobs

type ProfilerJobs struct {
	Queue string
}

ProfilerJobs implements webpprof.Integration for registered job slices.

func (ProfilerJobs) Name

func (d ProfilerJobs) Name() string

Name returns the job integration cache namespace.

func (ProfilerJobs) Profile

func (d ProfilerJobs) Profile(scope webpprof.Scope, jobs []Job) []Job

Profile wraps each job so execution results are recorded with the configured queue label.

type Queue

type Queue = queuecontract.Queue

Queue aliases the go-queue facade accepted by Profile.

func Profile

func Profile(queue Queue, names ...string) Queue

Profile instruments queue with the default profiler.

func ProfileWith

func ProfileWith(profiler *webpprof.Profiler, queue Queue, names ...string) Queue

ProfileWith instruments queue with an explicit profiler.

type Task

type Task = queuecontract.Task

Task aliases the go-queue dispatch builder returned by profiled queues.

func ChainContext

func ChainContext(ctx context.Context, queue Queue, jobs []queuecontract.Jobs) Task

ChainContext is the context-aware counterpart of queue.Chain.

func JobContext

func JobContext(ctx context.Context, queue Queue, job Job, args []queuecontract.Arg) Task

JobContext creates a task whose dispatch event is correlated with the request capture stored in ctx. The underlying go-queue Task API does not accept a context, so request handlers should use this helper instead of queue.Job when dispatches need to appear in the request details.

Jump to

Keyboard shortcuts

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