Introduction To Delayed Job
Upcoming SlideShare
Loading in...5
×
 

Introduction To Delayed Job

on

  • 7,179 views

An introduction to the delayed_job gem.

An introduction to the delayed_job gem.

Statistics

Views

Total Views
7,179
Views on SlideShare
6,561
Embed Views
618

Actions

Likes
4
Downloads
14
Comments
0

14 Embeds 618

http://jonathanjulian.com 443
http://www.funonrails.com 91
http://www.slideshare.net 31
http://localhost 30
http://funonrails.com 6
http://static.slidesharecdn.com 4
http://translate.googleusercontent.com 3
http://coderwall.com 2
http://webcache.googleusercontent.com 2
http://feeds.feedburner.com 2
http://127.0.0.1:8795 1
http://www.hanrss.com 1
http://jonathanjulian.org 1
http://www.linkedin.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Introduction To Delayed Job Introduction To Delayed Job Presentation Transcript

  • "Maybe we should have a talk on delayed_job" @subelsky
  • An Introduction to delayed_job @bmoreonrails 2009-11-10
  • I’m @jonathanjulian
  • Why do we need background processing?
  • User Experience
  • Sending an email
  • Resizing an image
  • Updating a web service
  • Geocoding
  • Batch import
  • Delayed::Job “Extracted from Shopify” database-persisted queue 0..n runners
  • tobi/delayed_job
  • collectiveidea/delayed_job
  • Setup
  • gem
  • The Queue
  • One db migration
  • Let’s delay something
  • Notifier.deliver_activation_instructions(self)
  • Notifier.send_later(:deliver_activation_instructions, self)
  • Easy!
  • class Notifier def deliver_activation_instructions(user) # ... end handle_asynchronously :deliver_activation_instructions end
  • Custom jobs
  • class LongRunningJob < Struct.new(:id) def perform # do some crazy long calculations end end Delayed::Job.enqueue LongRunningJob.new(42)
  • Who runs the jobs?
  • Workers
  • rake jobs:work # Start a delayed_job worker.
  • script/delayed_job start * collectiveidea/delayed_job only
  • Production Deployment
  • # play nice with Passenger require 'delayed/recipes' after "deploy:update_code", "delayed_job:stop" after "deploy:restart", "delayed_job:start"
  • http://railstips.org/ 2008/11/19/delayed- gratification-with-rails
  • "I highly recommend DelayedJob to anyone whose site is not 50% background work." @defunkt
  • @jonathanjulian http://jonathanjulian.com/
  • Photo Attributions • http://www.flickr.com/photos/aloshbennett/540105576/ • http://www.flickr.com/photos/gyrus/132436475/ • http://www.flickr.com/photos/gavatron/866650954/