Skip to content

[Question] Support polling as alternative to blocking commands? #3372

@CrazyWood007

Description

@CrazyWood007

​Context:​
In environments where Redis blocking commands (e.g. BRPOP, BLMOVE) are restricted (e.g. proxy-limited infrastructure or serverless runtimes), BullMQ fails to process jobs. These restrictions maybe prevent many users from adopting BullMQ.

​Problem:​

  • Blocking commands cause connection timeouts in serverless platforms (AWS Lambda, Cloudflare Workers)
  • Infrastructure proxies (e.g. Twemproxy) often block BRPOP/BLMOVE
  • No workaround exists in BullMQ to force non-blocking behavior

​Proposal:​
Introduce a pollInterval option for workers, replacing blocking commands with interval-based checks:

new Worker("my-queue", async job => { }, {
  settings: {
    worker: {
      pollInterval: 2000 // ms (disables BLPOP when set)
    }
  }
});

​Expected Behavior:​

  • Worker checks for jobs every pollInterval ms using non-blocking LRANGE/ZRANGE commands
  • Fallback to standard blocking mode when pollInterval is null/undefined
  • Document limitations: higher latency/Redis load tradeoff

​Use Cases:​

  1. Serverless deployments with connection timeout restrictions
  2. Proxy-mediated Redis connections
  3. Edge environments with incomplete Redis command support

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions