Sha256: 7204169d434e1946e55ff904e8b465d5abece8a2aaac5c653bada189e0b9510a

Contents?: true

Size: 610 Bytes

Versions: 3

Compression:

Stored size: 610 Bytes

Contents

# frozen_string_literal: true

module RabbitmqClient
  # ExchangeRegistry is a store for all managed exchanges and their details
  class Exchange
    attr_reader :name, :type, :options

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

    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rabbitmq_client-0.0.3 lib/rabbitmq_client/exchange.rb
rabbitmq_client-0.0.2 lib/rabbitmq_client/exchange.rb
rabbitmq_client-0.0.1 lib/rabbitmq_client/exchange.rb