4 ms·
I disagree. Cron is meant to run at specific intervals, not at specific, arbitrary times. In apps where we're using this technique, we may have hundreds or tho
by danielmorrison 16y ago
I disagree. Cron is meant to run at specific intervals, not at specific, arbitrary times.
In apps where we're using this technique, we may have hundreds or thousands of jobs scheduled at various times in the future (appointment reminders are a great example). Cron would have to check every minute or two, whereas we have Delayed Job already running a queue. They just get pulled in when their time is right.
- pavel_lishin 16y agoHow does delayed_job work? Does it just run as a daemon in the background?
- ryandotsmith 16y agoIt calls rake jobs:work.
- bryckbost 16y agoYep, it runs in the background. `script/delayed_job` can be used to manage the process or `rake jobs:work`. Either will start working off jobs.
- ryandotsmith 16y agoI doubt your jobs get pulled into the queue. You probably enqueue them and just inform your workers to execute them when the worker's Time.now > the job's run_at. This mean's you may have thousands of jobs in your queue at any moment. An advantage of using cron to schedule is that you won't have as many jobs in your queue at arbitrary times.