Worker
A worker is a background process that picks up tasks from a queue and executes them. Workers run independently from your main application, letting heavy or slow operations finish without affecting user-facing performance.
How Workers Operate
- Worker connects to the queue and listens for new tasks
- When a task is available, the worker claims it (preventing other workers from processing it)
- Worker executes the task (calling a webhook, running a computation, etc.)
- Worker reports the result back (success or failure)
- Worker picks up the next task
Scaling Workers
One of the key benefits of a queue-based architecture is horizontal scaling. Need more throughput? Add more workers.
- 1 worker: Sequential processing, simple and predictable
- N workers: Parallel processing, higher throughput
- Auto-scaling: Workers scale up and down based on queue depth
Worker Considerations
- Idempotency: Workers should handle duplicate task delivery gracefully
- Timeouts: Set appropriate timeouts to prevent workers from hanging on stuck tasks
- Concurrency: Configure how many tasks each worker processes simultaneously
- Health checks: Monitor worker processes to detect and recover from failures
Workers in AsyncQueue
AsyncQueue manages workers for you. Our horizontally scalable fleet processes your tasks automatically — no infrastructure to provision, no processes to monitor, no scaling to configure.