Net-Async-AMQP
view release on metacpan or search on metacpan
lib/Net/Async/AMQP.pod view on Meta::CPAN
Defaults to an extended version of the 0.9.1 protocol as used by RabbitMQ,
this is found in the C<amqp0-9-1.extended.xml> distribution sharedir (see
L<File::ShareDir>).
Normally, you should be able to ignore this. If you want to load an alternative
spec, note that (a) this is global, rather than per-instance, (b) it needs to
be set before you C<use> this module.
BEGIN { $Net::Async::AMQP::XML_SPEC = '/tmp/amqp.xml' }
use Net::Async::AMQP;
Once loaded, this module will not attempt to apply the spec again.
=head1 %CONNECTION_DEFAULTS
The default parameters to use for L</connect>. Changing these values is permitted,
but do not attempt to delete from or add any entries to the hash.
Passing parameters directly to L</connect> is much safer, please do that instead.
=head1 METHODS
=head2 configure
Set up variables. Takes the following optional named parameters:
=over 4
=item * heartbeat_interval - (optional) interval between heartbeat messages,
default is set by the L</HEARTBEAT_INTERVAL> constant
=item * max_channels - how many channels to allow on this connection,
default is defined by the L</MAX_CHANNELS> constant
=back
Returns the new instance.
=head2 bus
Event bus. Used for sharing global events such as connection closure.
=head2 connect
Takes the following parameters:
=over 4
=item * port - the AMQP port, defaults to 5672, can be a service name if preferred
=item * host - host to connect to, defaults to localhost
=item * local_host - our local IP to connect from
=item * user - which user to connect as, defaults to guest
=item * pass - the password for this user, defaults to guest
=item * ssl - true if you want to connect over SSL
=item * SSL_* - SSL-specific parameters, see L<IO::Async::SSL> and L<IO::Socket::SSL> for details
=back
Returns $self.
=head2 on_stream
Called once the underlying TCP connection has been established.
Returns nothing of importance.
=head2 on_read
Called whenever there's data available to be read.
=head2 on_closed
Called when the TCP connection is closed.
=head2 post_connect
Sends initial startup header and applies listener for the C< Connection::Start > message.
Returns $self.
=head2 setup_tuning
Applies listener for the Connection::Tune message, used for determining max frame size and heartbeat settings.
Returns $self.
=head2 open_connection
Establish a new connection to a vhost - this is called after tuning is complete,
and must happen before any channel connections are attempted.
Returns $self.
=head2 setup_connection
Applies listener for the Connection::OpenOk message, which triggers the
C<connected> event.
Returns $self.
=head2 connected
Returns a L<Future> which will resolve when the MQ connection is ready
for use.
=head2 next_channel
Returns the next available channel ready for L</open_channel>.
Note that whatever it reports will be completely wrong if you've
manually specified a channel anywhere, so don't do that.
If channels have been closed on this connection, those IDs will be
reused in preference to handing out a new ID.
=head2 create_channel
( run in 1.248 second using v1.01-cache-2.11-cpan-39bf76dae61 )