Class: RabbitmqClient::Exchange

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbitmq_client/exchange.rb

Overview

ExchangeRegistry is a store for all managed exchanges and their details

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, options) ⇒ Exchange

Returns a new instance of Exchange.



8
9
10
11
12
# File 'lib/rabbitmq_client/exchange.rb', line 8

def initialize(name, type, options)
  @name = name
  @type = type
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/rabbitmq_client/exchange.rb', line 6

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/rabbitmq_client/exchange.rb', line 6

def options
  @options
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/rabbitmq_client/exchange.rb', line 6

def type
  @type
end

Instance Method Details

#create(channel) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/rabbitmq_client/exchange.rb', line 14

def create(channel)
  exhange_obj = Bunny::Exchange.new(channel, @type, @name,
                                    @options)
  ActiveSupport::Notifications.instrument(
    'created_exhange.rabbitmq_client',
    name: @name,
    type: @type
  )
  exhange_obj
end