taskforcesh / bullmq

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

Native scheduled jobs #1816

Open coopbri opened 1 year ago

coopbri commented 1 year ago

Is your feature request related to a problem? Please describe.

I think the DX for scheduled jobs could be improved, with native support for job scheduling instead of having to perform a delay calculation as outlined in the delayed jobs documentation:

delay

Describe the solution you'd like

Agenda has a nice DX for scheduled jobs, simplified examples:

Describe alternatives you've considered

Wrapping BullMQ with a custom adapter

Additional context

Similar issue from Bull: https://github.com/OptimalBits/bull/issues/1648

manast commented 1 year ago

I am all for ergonomics but there are npm modules that solve this same thing. I think it is better to spend time maintaining core queue issues and features than maintaining a library for converting between human strings and milliseconds. Some alternatives: https://www.npmjs.com/package/parse-relative-time https://www.npmjs.com/package/ms

What we could do of course is provide examples in the documentation where these libraries are used.

coopbri commented 1 year ago

Completely understand. I think documentation examples would be beneficial (e.g. patterns/recipes for scheduled jobs containing those libraries, particularly the ms library due to its popularity).