Module | AMQP |
In: |
lib/amqp.rb
lib/amqp/version.rb lib/amqp/buffer.rb lib/amqp/client.rb lib/amqp/frame.rb lib/amqp/protocol.rb lib/amqp/server.rb |
VERSION | = | '0.6.7' |
closing | -> | closing? |
conn | -> | connection |
start | -> | run |
closing | [R] | |
conn | [R] | |
logging | [RW] |
Must be called to startup the connection to the AMQP server.
The method takes several arguments and an optional block.
This takes any option that is also accepted by EventMachine::connect. Additionally, there are several AMQP-specific options.
The username as defined by the AMQP server.
The password for the associated :user as defined by the AMQP server.
The virtual host as defined by the AMQP server.
Measured in seconds.
Toggle the extremely verbose logging of all protocol communications between the client and the server. Extremely useful for debugging.
AMQP.start do # default is to connect to localhost:5672 # define queues, exchanges and bindings here. # also define all subscriptions and/or publishers # here. # this block never exits unless EM.stop_event_loop # is called. end
Most code will use the MQ api. Any calls to MQ.direct / MQ.fanout / MQ.topic / MQ.queue will implicitly call start. In those cases, it is sufficient to put your code inside of an EventMachine.run block. See the code examples in MQ for details.