lib/cloudist/basic_queue.rb in cloudist-0.0.2 vs lib/cloudist/basic_queue.rb in cloudist-0.0.3
- old
+ new
@@ -49,11 +49,11 @@
begin
raise Cloudist::ExpiredMessage if request.expired?
yield request if block_given?
finished = Time.now.utc.to_i
-
+
rescue Cloudist::ExpiredMessage
log.info "amqp_message action=timeout #{tag} ttl=#{request.ttl} age=#{request.age} #{request.inspect}"
request.ack if amqp_opts[:ack]
rescue => e
@@ -74,9 +74,10 @@
def publish_to_q(payload)
body, headers = payload.formatted
q.publish(body, headers)
payload.publish
+ return headers
end
def teardown
@q.unsubscribe
@mq.close
\ No newline at end of file