lib/vx/lib/consumer/session.rb in vx-lib-consumer-0.2.2 vs lib/vx/lib/consumer/session.rb in vx-lib-consumer-0.3.0
- old
+ new
@@ -4,12 +4,10 @@
module Vx
module Lib
module Consumer
class Session
- include Instrument
-
@@session_lock = Mutex.new
@@shutdown_lock = Mutex.new
@@shutdown = ConditionVariable.new
@@live = false
@@ -39,21 +37,17 @@
end
def close
if open?
@@session_lock.synchronize do
- instrument("closing_connection", info: conn_info)
-
- instrument("close_connection", info: conn_info) do
- begin
- conn.close
- while conn.status != :closed
- sleep 0.01
- end
- rescue Bunny::ChannelError, Bunny::ClientTimeout => e
- Consumer.exception_handler(e, {})
+ begin
+ conn.close
+ while conn.status != :closed
+ sleep 0.01
end
+ rescue Bunny::ChannelError, Bunny::ClientTimeout => e
+ Consumer.exception_handler(e, {})
end
@conn = nil
end
end
end
@@ -69,18 +63,12 @@
nil, # from ENV['RABBITMQ_URL']
heartbeat: Consumer.configuration.heartbeat,
automatically_recover: false
)
- instrumentation = { info: conn_info }.merge(options)
-
- instrument("start_connecting", instrumentation)
-
- instrument("connect", instrumentation) do
- conn.start
- while conn.connecting?
- sleep 0.01
- end
+ conn.start
+ while conn.connecting?
+ sleep 0.01
end
end
end
self