-
-
Notifications
You must be signed in to change notification settings - Fork 280
Getting Started
Pablo Cantero edited this page Jul 1, 2017
·
4 revisions
class HelloWorker
include Shoryuken::Worker
shoryuken_options queue: 'hello', auto_delete: true
def perform(sqs_msg, name)
puts "Hello, #{name}"
end
end
bundle exec shoryuken sqs create hello
bundle exec shoryuken -q hello -r ./hello_worker.rb
HelloWorker.perform_async('Ken')
# app/jobs/hello_job.rb
class HelloJob < ActiveJob::Base
queue_as 'hello'
def perform(name)
puts "Hello, #{name}"
end
end
bundle exec shoryuken sqs create hello
# config/application.rb
module YourApp
class Application < Rails::Application
config.active_job.queue_adapter = :shoryuken
end
end
bundle exec shoryuken -q hello -R
HelloJob.perform_later('Ken')