-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Getting Started
jc00ke edited this page Feb 14, 2012
·
77 revisions
Sidekiq makes every effort to make usage with Rails 3 applications as simple as possible. sidekiq does not support Rails 2.x.
-
Add sidekiq to your Gemfile:
gem 'sidekiq' -
Add a worker in
app/workersto process messages asynchronously:class HardWorker include Sidekiq::Worker def perform(name, count) # do something end end
-
Send a message to be processed asynchronously:
HardWorker.perform_async('bob', 5)
-
Start sidekiq from the root of your Rails application so the message will be processed:
sidekiq
There are some non-Rails examples in examples/. por.rb is a "Plain Old Ruby" example, and sinkiq.rb is a Sinatra integration.