Module: Telemetry::AMQP

Defined in:
lib/telemetry/amqp.rb,
lib/telemetry/amqp/base.rb,
lib/telemetry/amqp/version.rb,
lib/telemetry/amqp/defaults.rb,
lib/telemetry/amqp/management.rb

Defined Under Namespace

Modules: Defaults, Management Classes: Base

Constant Summary collapse

VERSION =
'0.2.0'.freeze

Class Method Summary collapse

Class Method Details

.channelObject



25
26
27
28
29
# File 'lib/telemetry/amqp.rb', line 25

def channel
  return nil if session.nil?

  session.channel
end

.connect!(**opts) ⇒ Object



8
9
10
11
12
13
# File 'lib/telemetry/amqp.rb', line 8

def connect!(**opts)
  @connection = Telemetry::AMQP::Base.new(**opts)
  @connection.connect!

  @connection
end

.connectionObject



15
16
17
18
19
# File 'lib/telemetry/amqp.rb', line 15

def connection
  return @connection unless @connection.nil?

  nil
end

.create_channel(consumer_pool_size: 1, abort_on_exception: false, timeout: 30) ⇒ Object



31
32
33
# File 'lib/telemetry/amqp.rb', line 31

def create_channel(consumer_pool_size: 1, abort_on_exception: false, timeout: 30)
  session.create_channel(nil, consumer_pool_size, abort_on_exception, timeout)
end

.sessionObject



21
22
23
# File 'lib/telemetry/amqp.rb', line 21

def session
  @connection&.session
end