Ask A Question

Notifications

You’re not receiving notifications from this thread.

Background Workers with ActiveJob and Sidekiq Discussion

Great video, I deployed my app with capistrano every thing went well except sidekiq, the jobs are not running. I tried debugging but sidekiq command is not working on my production system, could you please help me on this.

Thanks,
Srinivas

Reply

I'd love to see a follow up on deploying to heroku!

Reply

That's a really good idea! I'll do that. :)

Reply

Thanks Chris, Great vídeo. Quick comment: I think that Activejob is not passing 6 arguments as said (around minute 22) but the argument "6". That should be the user ID. Looking forward to the follow up on deploying to digitalocean!

Reply

Chris, I'm having an issue with getting this background email to send on Heroku. Posted a SO question about it. Please take look at it if you get a chance. Thanks! Learning a ton from you. http://stackoverflow.com/qu...

Reply

Did you get this working? You'll need to also make sure your background job runner is a second command added to your Procfile. For example, you'd add sidekiq to your Procfile as a background process and that will make sure these deliver_later emails get sent on Heroku.

Reply

@Chris Oliver I followed this episode and it worked perfectly. One thing though I could not find good resource is how to update a job running time. In my case I have a reminder job, that send email to users 24 hours prior to the event. Now lets say the event is cancel/edited how do we update sidekiq to either modified the time or not run the job at all, can you please give me hint?

Thanks.

Reply

@excid3:disqus can you please address this when you have a chance?

Reply

Is there a more "beginner-like" version of background workers available? I'm particularly interested in automating e-mails, csv downloads + notifying the user per web or per mail. There really is nothing fundamental available online.
Thanks!

Reply

Since ActiveJob is just a wrapper for whatever background processor you use, all you have to do is write your code to use ActiveJob. All your emails already support ActiveJob, so to send them in the background you can just say "UserMailer.notification(user).deliver_later" and the deliver later part will create a job for it.

As for everything else like notifications and csv downloads, you'd just write your code in a job and have your controllers start the job. Nothing too fancy.

Is there anything specific I could cover for you that would help wrap your head around it?

Reply
Great video Chris
Reply
Hey Chris, do you think it's fine for an application to use the same Redis instance for Sidekiq and as cache store? I've seen a couple of Mike Perham's comments against it from a couple years back, but it just seems like a much simpler setup to only have Redis instead of Redis + Memcached.
Are there any special considerations/configs to take into account in your experience if you plan on using Redis for both?

Thanks!
Reply
I've been using Redis for Rails cache + Sidekiq for years now. Absolutely no problems. There's probably some rare situation that could cause trouble, but I prefer the simplicity of managing less services in production and it's worked just fine.
Reply
Thanks for the reply Chris!
Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,329+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.