souparno majumder
souparno majumder

Reputation: 2052

How does npm bull reads delayed jobs without using cron?

I was recently looking at npm bull package to use for delayed jobs. I can see that for delayed jobs it is using redis sorted set and mapping the value of the job to a hashset in redis. But I fail to understand how does the process receives the delayed job on time without using any iterable function like a cron or a settimeout which might be used to constantly looks for the jobs, and pops them by the score? can any one help me point to the code which is responsible for getting the delayed jobs?

Upvotes: 0

Views: 732

Answers (1)

Artem Loginov
Artem Loginov

Reputation: 53

It actually have recurring setInterval call, no magic here.

Upvotes: 2

Related Questions