lib/splash/transports/rabbitmq.rb in prometheus-splash-0.2.0 vs lib/splash/transports/rabbitmq.rb in prometheus-splash-0.3.0
- old
+ new
@@ -62,11 +62,12 @@
def execute(order)
queue = order[:return_to]
lock = Mutex.new
res = nil
condition = ConditionVariable.new
- get_default_subscriber(queue: queue).subscribe(timeout: 5) do |delivery_info, properties, payload|
+ get_default_subscriber(queue: queue).subscribe do |delivery_info, properties, payload|
res = YAML::load(payload)
+
lock.synchronize { condition.signal }
end
get_default_client.publish queue: order[:queue], message: order.to_yaml
lock.synchronize { condition.wait(lock) }
return res