Sidekiq-in-1-minute

1 Minute Sidekiq lighting -- railsconf2012 | by @jwo

Download as .zip Download as .tar.gz View on GitHub

Sidekiq in 1 minute

1 Minute lighting talk: A simple Sidekiq Example

Big Takeaways!

For more information, you should check out http://mperham.github.com/sidekiq/

Steps (after you clone and bundle)

  1. Run the sidekiq worker

    bundle exec sidekiq -r ./worker.rb
    
  2. Run the code

    ruby demo
    
  3. That's it!

On Your Own

# In your code
DoingIt.perform_async

# The worker
class DoingIt
  include Sidekiq::Worker
  def perform
    puts "the stuff"
  end
end

In Rails 3

  1. Add to bundler
  2. Add to capistrano require 'sidekiq/capistrano'

Prereqs

  1. Have Redis installed and running (brew install redis)
  2. Ruby 1.9