Sidekiq
Simple, efficient message processing for Ruby.
Put sidekiq in your Gemfile:
gem 'sidekiq'
Install the gem with Bundler:
bundle install
Place your worker classes in app/workers:
# app/workers/hard_worker.rb
class HardWorker
include Sidekiq::Worker
def perform(name, count)
puts 'Doing hard work'
end
end
In your controller action or model, call HardWorker.perform_async:
HardWorker.perform_async('bob', 5)
Finally, start sidekiq from the root directory of your Rails app.
bundle exec sidekiq