Develop Queue locally

Use the memory provider for local development and understand how auto-selection works.

Memory is the default local-development path for Queue. It keeps everything in one Node.js process, so you can define a queue, enqueue work, and watch the handler run without extra infrastructure.

How provider selection works locally

When no supported cloud environment is detected, ViteHub can auto-select the memory provider at runtime.

That means you can often develop locally without setting queue.provider at all.

When to keep Memory explicit

Set queue.provider = 'memory' when you want:

  • predictable local behavior across machines
  • a quickstart that shows the provider choice clearly
  • tests or demos that should never depend on hosting detection

Use Quickstart for the smallest explicit setup.

What Memory is good for

Use Memory when you want to:

  • prove the queue wiring works
  • test the handler locally
  • iterate on payload shape and validation
  • demo Queue without external services

What Memory is not good for

Do not treat Memory as a production backend.

  • jobs stay in process memory
  • jobs are lost when the server restarts
  • failed jobs are logged but not retried
  • there is no external delivery guarantee

When you need durable delivery, move to one of the hosted providers.

A good local loop

  1. Start with Memory.
  2. Define a queue in src/queues/** or server/queues/**.
  3. Enqueue from a local API route with runQueue().
  4. Add payload validation once the flow works.
  5. Switch to a hosted provider only after the queue contract is stable.