Class | AMQ::Client::Async::EventMachineClient |
In: |
lib/amq/client/async/adapters/event_machine.rb
|
Parent: | EM::Connection |
Deferrable | = | EventMachine::DefaultDeferrable | Backwards compatibility with 0.7.0.a25. MK. |
disconnect | -> | close |
send_data | -> | send_raw |
Initiates connection to AMQP broker. If callback is given, runs it when (and if) AMQP connection succeeds.
@option settings [String] :host ("127.0.0.1") Hostname AMQ broker runs on. @option settings [String] :port (5672) Port AMQ broker listens on. @option settings [String] :vhost ("/") Virtual host to use. @option settings [String] :user ("guest") Username to use for authentication. @option settings [String] :pass ("guest") Password to use for authentication. @option settings [String] :ssl (false) Should be use TLS (SSL) for connection? @option settings [String] :timeout (nil) Connection timeout. @option settings [String] :logging (false) Turns logging on or off. @option settings [String] :broker (nil) Broker name (use if you intend to use broker-specific features). @option settings [Fixnum] :frame_max (131072) Maximum frame size to use. If broker cannot support frames this large, broker‘s maximum value will be used instead.
@param [Hash] settings
Whether we are in authentication state (after TCP connection was estabilished but before broker authenticated us).
@return [Boolean] @api public
Called when time since last server heartbeat received is greater or equal to the heartbeat interval set via :heartbeat_interval option on connection.
@api plugin
Defines a callback that will be run when broker confirms connection termination (client receives connection.close-ok). You can define more than one callback.
@api public
Defines a callback that will be executed when AMQP connection is considered open: client and broker has agreed on max channel identifier and maximum allowed frame size and authentication succeeds. You can define more than one callback.
@see on_possible_authentication_failure @api public
Periodically try to reconnect.
@param [Fixnum] period Period of time, in seconds, to wait before reconnection attempt. @param [Boolean] force If true, enforces immediate reconnection. @api public
EventMachine reactor callback. Is run when TCP connection is estabilished but before resumption of the network loop. Note that this includes cases when TCP connection has failed. @private
EventMachine receives data in chunks, sometimes those chunks are smaller than the size of AMQP frame. That‘s why you need to add some kind of buffer.
@private
Reconnect after a period of wait.
@param [Fixnum] period Period of time, in seconds, to wait before reconnection attempt. @param [Boolean] force If true, enforces immediate reconnection. @api public
Called by EventMachine reactor when
@private