logo

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

  1. Worker connects to the queue and listens for new tasks
  2. When a task is available, the worker claims it (preventing other workers from processing it)
  3. Worker executes the task (calling a webhook, running a computation, etc.)
  4. Worker reports the result back (success or failure)
  5. 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.