Live data from Hacker News

Show HN: Lightweight job scheduling for Node.js

github.com

1–10 of 17 posts

Re: Show HN: Lightweight job scheduling for Node.js

#2
I am working on a scheduled reminder (email/SMS service) to send notifications. I've been looking for a scheduling/Cron service for node. There are few I am evaluating. I will consider yours. If I reboot the machine or node server, will it automatically queue up the jobs?

Re: Show HN: Lightweight job scheduling for Node.js

#3
post #2

I am working on a scheduled reminder (email/SMS service) to send notifications. I've been looking for a scheduling/Cron service for node. There are few I am evaluating. I will consider yours. If I reboot the machine or node server, will it automatically queue up the jobs?

So if you reboot the server, you just need to make sure that you call agenda.start() again. This will start the job processor which looks for jobs that have come due in the database and process them. agenda.every('3 minutes', 'job name') is a special case in which it will only schedule that job once (because if you think about it, otherwise every time you ran that line you'd get a new job... This makes it so you can define it in the same file as where you call agenda.start() and not end up defining new versions of those repeating jobs every time the file gets ran). Hope this makes sense/helps.

Re: Show HN: Lightweight job scheduling for Node.js

#7
post #4

Curious, why the choice of mongo vs something like redis?

The choice of Mongo vs Redis was intentional. Without configuration Redis doesn't guarantee persistence as well as Mongo. Since Redis is often used for non-critical data such as sessions I didn't want to enforce sacrificing performance of sessions for persistence.

Re: Show HN: Lightweight job scheduling for Node.js

#8
post #5
post #4

Curious, why the choice of mongo vs something like redis?

I thought the same. For redis there's Kue, which looks a lot more feature complete. https://github.com/learnboost/kue

See above for Mongo vs Redis. As for "feature completeness", this is a pretty feature complete job scheduling library. It leaves the writing of a Web interface to someone else, but for scheduling jobs it gets the job done. (Haha, that pun was irresistible)

Re: Show HN: Lightweight job scheduling for Node.js

#9
If you wanted even more flexible schedules, you might want to look into Later.js (http://bunkat.github.io/later/), a small library I created just for this purpose. It supports composite and exception schedules, cron schedules, and lots of different time periods. Everything can be specified using an API or using English text.

I also built replacements for setTimeout and setInterval to use Later schedules, so it should be easy enough to plug it into your solution.

Re: Show HN: Lightweight job scheduling for Node.js

#10
post #9

If you wanted even more flexible schedules, you might want to look into Later.js ( http://bunkat.github.io/later/ ), a small library I created just for this purpose. It supports composite and exception schedules, cron schedules, and lots of different time periods. Everything can be specified using an API or using English text. I also built replacements for setTimeout and setInterval to use Later schedules, so it shou…

[deleted]
Post reply on HN