taskforcesh / bullmq

BullMQ - Message Queue and Batch processing for NodeJS and Python based on Redis
https://bullmq.io
MIT License
6k stars 387 forks source link

addJob from serverless environment #2615

Open psteinroe opened 3 months ago

psteinroe commented 3 months ago

Is your feature request related to a problem? Please describe. We want to addJobs to our upstash-redis backed queue from a Cloudflare Worker. Afaik, this is not really supported

Describe the solution you'd like Since this is just single command, maybe one could provide a small util lib based off upstash-redis that only supports addJob for a queue?

Describe alternatives you've considered Not adding jobs from cf worker

manast commented 3 months ago

Unfortunately adding jobs does require using .lua scripts as the adding operation is too complex to be implemented using a standard Redis multi. Technically it should be possible to just send the whole add script using Redis command EVAL instead of as BullMQ does it today, which is first load the scripts and then use EVALSHA. I am not sure if this is something that will work well with cloudflare + upstash though.