v1.1.3

Configuration

Last updated


This page covers every queue-level Config field, its default, and how zero values resolve. go-queue reads no environment variables or config files; all settings go into core.New as a struct.

Config


  1. type Config struct {
  2. Workers int
  3. Size int
  4. Timeout time.Duration
  5. Preset map[string]PresetConfig
  6. }

FieldDefault When ZeroDescription
Workersruntime.NumCPU() * 2Number of concurrent workers
SizeWorkers * 64 (using the default Workers)Heap capacity, retries included; Enqueue errors once full
Timeout30 * time.SecondGlobal base timeout; also sets promotion thresholds
Presetempty mapPreset name → PresetConfig; New copies it, so later edits to your map do not affect the queue

Zero-Value Resolution


InputResult
New(nil)Every default
Only Workers: 1Size stays NumCPU * 2 * 64: the Size default derives from runtime.NumCPU() * 2, not from the Workers you pass (core/new.go:44)
Negative valuesNot rejected; non-zero values are used as given

Named presets are covered in Presets; per-task adjustments in Enqueue Options.
中文