local

package
v0.2.61 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MPL-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package local is the in-process cron Queue: a buffered channel feeding a fixed pool of worker goroutines. Single-node default — preserves the chassis's "fire and drain per dispatch" behavior, but bounds how many dispatches run at once (a fan-out of N slow tenants can't spawn N unbounded goroutines). Selected with --cron-queue=local (the default).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

Queue is the in-process cron Queue.

func (*Queue) Enqueue

func (q *Queue) Enqueue(ctx context.Context, job cron.Job) error

Enqueue sends a job onto the buffered channel. Honors ctx so a shutting-down scheduler doesn't block forever on a full buffer (a full buffer is intended backpressure — the worker pool hasn't drained the previous fan-out).

func (*Queue) Name

func (*Queue) Name() string

func (*Queue) Work

func (q *Queue) Work(ctx context.Context, fn func(context.Context, cron.Job) error) error

Work starts q.max worker goroutines, each pulling jobs and calling fn synchronously. Receiving a job off the channel is the at-most-one-worker guarantee — no separate semaphore, no goroutine-per-job. Work returns after ctx is cancelled and every worker has finished its current fn.

Jump to

Keyboard shortcuts

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