Class: Surety::Processor
- Inherits:
-
Object
- Object
- Surety::Processor
- Defined in:
- lib/surety/processor.rb
Class Method Summary collapse
Class Method Details
.perform ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/surety/processor.rb', line 6 def self.perform = nil puts "[Surety::Processor]: Handling surety message" begin = Surety::Message.get_next_for_processing puts "[Surety::Processor]: Found message #{.inspect}" .process if rescue Exception => ex puts "[Surety::Processor]: error #{ex.to_s}" puts "[Surety::Processor]: #{ex.backtrace.join("\n")}" raise ex ensure sleep 5 if .nil? request_next end end |
.request_next ⇒ Object
24 25 26 |
# File 'lib/surety/processor.rb', line 24 def self.request_next Resque.enqueue(self) end |