Class: Twingly::AMQP::TopicExchangePublisher

Inherits:
Object
  • Object
show all
Includes:
Publisher
Defined in:
lib/twingly/amqp/topic_exchange_publisher.rb

Instance Method Summary collapse

Methods included from Publisher

#configure_publish_options, #publish, #publish_with_confirm

Constructor Details

#initialize(exchange_name:, routing_key: nil, connection: Connection.instance, opts: {}) ⇒ TopicExchangePublisher

Returns a new instance of TopicExchangePublisher.



6
7
8
9
10
# File 'lib/twingly/amqp/topic_exchange_publisher.rb', line 6

def initialize(exchange_name:, routing_key: nil, connection: Connection.instance, opts: {})
  options.routing_key = routing_key

  @exchange = connection.create_channel.topic(exchange_name, opts)
end