01 Jul '14, 5am

[Rails] Sidekiq の Worker で Amazon SQS のメッセージを処理する

[Rails] Sidekiq の Worker で Amazon SQS のメッセージを処理する

# app/models/concerns/sqs_usable.rb module SqsUsable extend ActiveSupport::Concern def initialize(queue_name) @queue_name = queue_name end def sqs @sqs ||= Aws::SQS.new(region: Settings.region, endpoint: Settings.endpoint) end def receive_message(max_number = 10) sqs.receive_message(queue_url: queue_url, max_number_of_messages: max_number) end def batch_delete(entries) sqs.delete_message_batch(queue_url: queue_url, entries: entries) end def queue_url @queue_url ||= "#{Settings.queue_url}/#{@queue_name}" end end

Full article: http://dev.classmethod.jp/server-side/ruby-on-rails/sidek...

Tweets

[Rails]既存DBを操作するAPIを作成する | Developers.IO

dev.classmethod.jp 03 Jul '14, 12am

$ rails console Loading development environment (Rails 4.1.2) irb(main):001:0> WpUser.all WpUser Load (0.2ms) SELECT `wp_u...

Was working with Sidekiq over the weekend and g...

stackoverflow.com 23 Jun '14, 4pm

Whenever I call a Sidekiq worker I'm getting the following error: Redis::InheritedError (Tried to use a connection from a ...