Class: Primer::Bus::AMQP
- Inherits:
-
Primer::Bus
- Object
- Primer::Bus
- Primer::Bus::AMQP
- Defined in:
- lib/primer/bus/amqp.rb
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ AMQP
constructor
A new instance of AMQP.
- #publish(topic, message) ⇒ Object
- #subscribe(*args, &block) ⇒ Object
Methods inherited from Primer::Bus
#distribute, #unsubscribe, #unsubscribe_all
Constructor Details
#initialize(config = {}) ⇒ AMQP
Returns a new instance of AMQP.
8 9 10 11 |
# File 'lib/primer/bus/amqp.rb', line 8 def initialize(config = {}) @config = config super() end |
Instance Method Details
#publish(topic, message) ⇒ Object
13 14 15 16 |
# File 'lib/primer/bus/amqp.rb', line 13 def publish(topic, ) tuple = [topic.to_s, ] queue.publish(Primer.serialize(tuple)) end |
#subscribe(*args, &block) ⇒ Object
18 19 20 21 |
# File 'lib/primer/bus/amqp.rb', line 18 def subscribe(*args, &block) bind super end |