Class: RosettaQueue::Gateway::BaseExchange
- Inherits:
-
Object
- Object
- RosettaQueue::Gateway::BaseExchange
- Defined in:
- lib/rosetta_queue/adapters/amqp.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(user, pass, host) ⇒ BaseExchange
constructor
A new instance of BaseExchange.
- #publish_to_exchange(destination, message, options = {}) ⇒ Object
Constructor Details
#initialize(user, pass, host) ⇒ BaseExchange
Returns a new instance of BaseExchange.
57 58 59 |
# File 'lib/rosetta_queue/adapters/amqp.rb', line 57 def initialize(user, pass, host) @user, @pass, @host = user, pass, host end |
Instance Method Details
#publish_to_exchange(destination, message, options = {}) ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/rosetta_queue/adapters/amqp.rb', line 61 def publish_to_exchange(destination, , ={}) unless EM.reactor_running? EM.run do (destination, , ) EM.add_timer(1) { EM.stop_event_loop } end else (destination, , ) end end |