13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/rabbit_wq/message_handler.rb', line 13
def call( options )
Time.zone = RabbitWQ.configuration.time_zone
channel = options[:channel]
delivery_info = options[:delivery_info]
metadata = options[:metadata]
payload = options[:payload]
worker = YAML::load( payload )
info ANSI.yellow { "WORKER [#{worker.object_id}] " + worker.inspect }
handle_work( worker, payload )
try_on_success_callback( worker )
channel.ack delivery_info.delivery_tag
rescue => e
handle_error( worker, e, channel, delivery_info, payload, metadata )
end
|