-
Notifications
You must be signed in to change notification settings - Fork 8
Jobs Queue
JP Barbosa edited this page Jul 23, 2015
·
2 revisions
brew install redis
nano Gemfile
gem 'sidekiq'
gem 'sinatra', require: nil
bundle install
nano config/application.rb
...
config.active_job.queue_adapter = :sidekiq
end
end
nano config/routes.rb
...
require 'sidekiq/web'
mount Sidekiq::Web => '/sidekiq'
...
echo dump.rdb >> .gitignore
redis-server
sidekiq -q mailers
rails s
rails c
ArticleMailer.recommend(Article.first, '[email protected]').deliver_later
open http://localhost:3000/sidekiq
git add .
git commit -m "Add Sidekiq to send messages using queues"