π Enterprise-grade, local-first background job engine for Go
Zero external dependencies β’ BoltDB persistence β’ Python & TypeScript SDKs
Quick Start β’ SDKs β’ Documentation β’ Contributing
| Feature | Description |
|---|---|
| πΎ Durable Storage | BoltDB-backed persistence β jobs survive crashes and restarts |
| β‘ Priority Queues | Critical, High, Normal, Low, and Bulk priority levels |
| π Smart Retries | Exponential, linear, or constant backoff strategies |
| π Observability | Prometheus metrics, structured logging, health checks |
| π‘οΈ Fault Tolerant | Panic recovery, checkpointing, graceful shutdown |
| π Security Ready | API key auth, role-based authorization |
| π Job Dependencies | Chain jobs with wait conditions |
| π Idempotency | Built-in deduplication via idempotency keys |
go install github.com/sa001gar/gopherqueue/cmd/gq@latestgq serve # Default: 10 workers, port 8080
gq serve --http :8080 --workers 20 --data-dir ./data # Custom configdocker run -d --name gopherqueue -p 8080:8080 -v gq_data:/data sa001gar/gopherqueue:latest# CLI
gq submit --type email --payload '{"to": "user@example.com"}'
# HTTP API
curl -X POST http://localhost:8080/api/v1/jobs \
-H "Content-Type: application/json" \
-d '{"type": "email", "payload": {"to": "user@example.com"}, "priority": 1}'Use GopherQueue from any language with our official SDKs.
pip install gopherqueuefrom gopherqueue import GopherQueueSync
queue = GopherQueueSync("http://localhost:8080")
job = queue.submit("email", {"to": "user@example.com"})
print(f"Job {job.id} queued!") |
npm install gopherqueueimport { GopherQueue } from "gopherqueue";
const queue = new GopherQueue("http://localhost:8080");
const job = await queue.submit("email", { to: "user@example.com" });
console.log(`Job ${job.id} queued!`); |
βββββββββββββββ
β completed β
βββββββββββββββ
β²
β success
βββββββββββ βββββββββββββ βββββββββββ΄ββββ
β pending βββββΆβ scheduled βββββΆβ running β
βββββββββββ βββββββββββββ ββββββββ¬βββββββ
β failure
ββββββββββββββββββββ΄βββββββββββββββββββ
βΌ βΌ
ββββββββββββββ ββββββββββββ
β retrying β β failed β
ββββββββββββββ βββββββ¬βββββ
β
βΌ
βββββββββββββββ
β dead_letter β
βββββββββββββββ
| State | Description |
|---|---|
pending |
Created, waiting to be scheduled |
scheduled |
In priority queue, ready for pickup |
running |
Worker actively processing |
completed |
Finished successfully |
retrying |
Failed, waiting for retry |
failed |
Exceeded max attempts |
dead_letter |
Permanently failed, needs manual intervention |
| Flag | Default | Description |
|---|---|---|
--http |
:8080 |
HTTP server address |
--workers |
10 |
Concurrent worker count |
--data-dir |
./data |
BoltDB storage directory |
--shutdown-timeout |
30s |
Graceful shutdown timeout |
| Priority | Value | Use Case |
|---|---|---|
| Critical | 0 | System alerts, payments |
| High | 1 | User-initiated actions |
| Normal | 2 | Standard background work |
| Low | 3 | Batch processing |
| Bulk | 4 | Data migrations |
| Guide | Description |
|---|---|
| π SDK Guide | Complete SDK reference with framework examples |
| π Deployment | Self-hosting, Docker, Kubernetes |
| π API Spec | REST API documentation |
| ποΈ Architecture | System design & internals |
| π Security | Auth, authorization, best practices |
| π Observability | Metrics, logging, monitoring |
| Framework | Link |
|---|---|
| π Django | Complete Integration Guide |
| βοΈ Next.js | API Routes Example |
| πΆοΈ Flask / FastAPI | Python Web Frameworks |
gopherqueue/
βββ api/ # HTTP API handlers
βββ cli/ # Command-line interface
βββ cmd/gq/ # Main entry point
βββ core/ # Core types & options
βββ docs/ # Documentation
βββ observability/ # Metrics & health
βββ persistence/ # Storage (BoltDB)
βββ scheduler/ # Priority queue
βββ sdks/ # Python & TypeScript SDKs
βββ security/ # Auth & authorization
βββ worker/ # Job execution
Contributions welcome! Please read our Contributing Guide.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License β see LICENSE.
Built with β€οΈ for developers who value simplicity