How does npm bull reads delayed jobs without using cron?

431 views Asked by At

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?

1

There are 1 answers

1
Artem Loginov On

It actually have recurring setInterval call, no magic here.