Task queues are deceptively simple. You push a job, a worker picks it up, and it gets done. But once you need reliability, retries, and horizontal scaling, things get interesting fast.
// This is a single-line comment
let greeting = "Hello, JavaScript!";
document.getElementById("demo").innerHTML = greeting;
| Column A | Column B |
|---|---|
| cell 1 | cell 2 |
| cell 3 | cell 4 |
NOTE
Useful information.
preview
Existing solutions like Celery and Sidekiq are great, but they come with opinions. I wanted something lightweight that spoke gRPC natively and could be embedded into existing Go services.
At its core, the queue is backed by Redis sorted sets. Each job gets a score based on its scheduled execution time, making delayed jobs trivial.
Workers poll the queue using BZPOPMIN, which blocks until a job is available. This keeps CPU usage near zero when idle.
Failed jobs get exponential backoff with jitter. After a configurable number of retries, they land in a dead-letter queue for manual inspection.