Class: PatternMatchingRabbitMQTopic
- Inherits:
-
BaseRabbitMQTopic
- Object
- BaseRabbitMQTopic
- PatternMatchingRabbitMQTopic
- Defined in:
- lib/postcard_rb/dispatchers/RabbitMQ/routings/PatternMatching/PatternMatchingRabbitMQTopic.rb
Instance Method Summary collapse
- #createRoom(name:, exclusive: false, autoDelete: false) ⇒ Object
-
#initialize(name:, channel:) ⇒ PatternMatchingRabbitMQTopic
constructor
A new instance of PatternMatchingRabbitMQTopic.
- #publish(room:, payload:, correlationId: nil, replyTo: nil) ⇒ Object
Constructor Details
#initialize(name:, channel:) ⇒ PatternMatchingRabbitMQTopic
Returns a new instance of PatternMatchingRabbitMQTopic.
5 6 7 8 9 10 |
# File 'lib/postcard_rb/dispatchers/RabbitMQ/routings/PatternMatching/PatternMatchingRabbitMQTopic.rb', line 5 def initialize name:, channel: super() @channel = channel @exchange = @channel.topic(name, :durable => false) end |
Instance Method Details
#createRoom(name:, exclusive: false, autoDelete: false) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/postcard_rb/dispatchers/RabbitMQ/routings/PatternMatching/PatternMatchingRabbitMQTopic.rb', line 12 def createRoom name:, exclusive: false, autoDelete: false room = PatternMatchingRabbitMQRoom.new( name: name, exclusive: exclusive, autoDelete: autoDelete, channel: @channel, exchange: @exchange ) addRoom(room: room) return room end |
#publish(room:, payload:, correlationId: nil, replyTo: nil) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/postcard_rb/dispatchers/RabbitMQ/routings/PatternMatching/PatternMatchingRabbitMQTopic.rb', line 26 def publish room:, payload:, correlationId: nil, replyTo: nil @exchange.publish( payload, :routing_key => room, :correlation_id => correlationId, :reply_to => replyTo, :persistent => false ) end |