[!NOTE] This README was generated by SKILL, get the ZH version from here.
PRIORITY-AWARE TASK QUEUE FOR GO
A Go task queue library with priority scheduling, timeout retries, and an atomic state machine
Table of Contents
Features
go get github.com/pardnchiu/go-queue· Documentation
- Five-Level Priority Queue — Orders Immediate, High, Retry, Normal, and Low tasks, with automatic promotion after wait timeouts.
- Worker Pool Parallelism — Defaults to CPU×2 workers with configurable queue capacity and global timeout.
- Timeout and Retry — Isolates panics, enforces per-task timeouts, and re-enqueues failed tasks at the highest priority.
- Functional Options — Configures each enqueue with WithTaskID, WithTimeout, WithCallback, and WithRetry.
- Atomic State Machine — Transitions Created, Running, and Closed via CAS for lock-free, idempotent Shutdown.
Architecture
graph TB
App[Application] --> Enqueue[Enqueue]
Enqueue --> Pending[Pending Heap]
Pending --> Workers[Worker Pool]
Workers --> Execute[Execute / Timeout / Retry]
App --> Start[Start]
App --> Shutdown[Shutdown]
Start --> Workers
Shutdown --> Pending
License
This project is licensed under the MIT LICENSE.
Author
邱敬幃 Pardn Chiu
hi@pardn.io
https://www.linkedin.com/in/pardnchiu
©️ 2025 邱敬幃 Pardn Chiu