0

I would need a queue system with scheduling support for a Ruby on Rails application. This is scheduling a job to be run at a certain time. Also it could be modified to be run sooner or later, or removed from the queue.

I'm thinking of using Sidekiq, but as I'm using a PostgreSQL database I was looking at queue_classic, but it seems not to have scheduling support.

Which one is a simple system that can handle timers?

David Morales
  • 17,816
  • 12
  • 77
  • 105

2 Answers2

1

I would recommend sidekiq. It uses the mulithreading Actor Framework Celluloid and runs several background Jobs concurrently. It is not an Option if you want a sequentinal execution order of enqueued jobs

dre-hh
  • 7,840
  • 2
  • 33
  • 44
  • And anyway you should be also using some process monitoring daemon like monit. We actually do also experience delay job crashes but it's just getting restarted by monit – dre-hh Jul 15 '14 at 06:57
  • What about the overhead of having Delayed_Job + monit, or just Sidekiq? – David Morales Jul 15 '14 at 09:30
  • Would use monit with sidekiq either. So not much overhead. – dre-hh Jul 15 '14 at 09:31
  • I would monit everything necessary. It's much more stable than god by the way. And for the overhead of sidekiq - sooner or later you will be thinking about a memcache solution anyway. Lucky you've already setup redis - one of the best one available – dre-hh Jul 15 '14 at 09:41
0

Check out delayed job, it enables both queuing and scheduling

https://github.com/collectiveidea/delayed_job

Example

# with delayed_job running at a specific time
Notifier.delay(run_at: 5.minutes.from_now).signup(@user)

You could also take a look at https://github.com/javan/whenever for setting up cron jobs.

There is also a railscasts episodes for each of these gems (requires a subscription): http://railscasts.com/episodes/164-cron-in-ruby-revised http://railscasts.com/episodes/164-cron-in-ruby-revised

NorOddSto
  • 146
  • 4
  • I have used Delayed_Job + whenever for a big project and I ran into issues with tasks not being executed. Simply restarting Delayed_Job fixed the problem, but it happened many times, so it's not reliable for me. Check their Github issues page, at this moment they have almost 200 open issues! – David Morales Jul 15 '14 at 06:36
  • Which is abolutely normal for an active project – dre-hh Jul 15 '14 at 06:48