v1.1.3

Core Concepts

Last updated

This page maps each scheduling question to the page that answers it; every rule below lives in github.com/pardnchiu/go-queue/core.

Where to Look

Question Page
Which task runs first, and where does its priority come from? Priority Levels
Can a low-priority task wait forever? Anti-Starvation Promotion
How long may a task run? Timeout Derivation
What happens on panic, timeout, or error, and how do retries work? Execution and Retries
When can I call Enqueue, Start, and Shutdown? Queue Lifecycle

Task Path at a Glance

  1. Enqueue resolves the preset's priority and timeout, then pushes the task into one bounded min-heap
  2. An idle worker calls Pop; each Pop first promotes tasks that have waited too long
  3. The worker runs the task under a timeout ctx with panic recovery
  4. A failed task with retries left re-enters the heap at PriorityRetry; everything else ends in a slog event
中文