-
Notifications
You must be signed in to change notification settings - Fork 500
Open
Description
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-blockingLRANGE
/ZRANGE
commands - Fallback to standard blocking mode when
pollInterval
is null/undefined - Document limitations: higher latency/Redis load tradeoff
Use Cases:
- Serverless deployments with connection timeout restrictions
- Proxy-mediated Redis connections
- Edge environments with incomplete Redis command support
Metadata
Metadata
Assignees
Labels
No labels