Module: Sidekiq::Sqs::Processor

Extended by:
ActiveSupport::Concern
Defined in:
lib/sidekiq-sqs/processor.rb

Instance Method Summary collapse

Instance Method Details

#process_with_sqs(sqs_message, queue) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/sidekiq-sqs/processor.rb', line 14

def process_with_sqs(sqs_message, queue)
  begin
    process_without_sqs(Zlib::Inflate.inflate(Base64.decode64(sqs_message.body)), queue).tap do
      sqs_message.delete
    end
  rescue Celluloid::Task::TerminatedError => error
    # If our thread was killed, requeue the job (SURE HOPE IT'S IDEMPOTENT!)
    sqs_message.visibility_timeout = 10 
  rescue => fatal
    # FIXME Maybe we want to requeue here, if there's a non-job related error?
    # If retry = true, requeue here
    sqs_message.delete
  end
end

#stats(*args) ⇒ Object



29
30
31
32
# File 'lib/sidekiq-sqs/processor.rb', line 29

def stats(*args)
  # FIXME this should, like, do stuff
  yield
end