NAME
POE::Component::Client::AMQP::Channel - AMQP Channel object
DESCRIPTION
Create using the POE::Component::Client::AMQP objects' channel()
command. Calling channel()
also retrieves previously created Channel objects. Alternatively, you can use the create()
class method below to create it directly.
CLASS METHODS
create (...)
- id (optional)
-
Provide an id or one will be generated for you.
- server (required)
-
Pass the POE::Component::Client::AMQP parent object here.
- Alias (default: ${parent_alias}-channel-$id)
-
The POE::Session alias so you can post to it's POE states.
- Callbacks (default: {})
-
At the moment, only 'Created' is used.
- CascadeFailure (default: 1)
-
If this channel is closed, close also the server connection.
Creates a new POE::Session that controls communications on a new AMQP channel. Pass a list of key/value pairs as follows:
Returns an object in this class.
OBJECT METHODS
id
Returns the channel id.
server
Returns the POE::Component::Client::AMQP parent object.
Alias
Returns the POE::Session alias of the controlling session.
do_when_created (...)
See POE::Component::Client::AMQP::do_when_startup(); similar behavior.
send_frames (...)
Same as the POE state server_send, but can be called on the object and before the channel is created.
queue ($name, \%opts)
Creates a new queue named $name. If no name is given, the server will generate a name for you, which will be available in $queue_object->name after the queue is created. Returns a new POE::Component::Client::AMQP::Queue object. This is a deferred call, similar to POE::Component::Client::AMQP::channel(), so it can be used immediately.
If you pass %opts, the values you pass will override defaults in the Net::AMQP::Protocol::Queue::Declare::new() call. These are arguments like 'ticket', 'passive', 'durable', 'exclusive', 'auto_delete', 'nowait' and 'arguments' (for version 0-8 of the protocol). See Net::AMQP::Protocol::Queue::Declare for the details of these arguments.
qos (\%opts, $on_complete)
Requests a specific quality of service from the server. The %opts are 'prefetch_size' and 'prefetch_count'.
$on_complete is an option callback that will be passed a boolean value indicating whether the QoS was set.
This is a deferred call, similar to POE::Component::Client::AMQP::channel(), so it can be used immediately.
POE STATES
The following are states you can post to to interact with the client. Use the alias defined in the create()
call above.
server_send (@frames)
Wraps the parent POE::Component::Client::AMQP::server_send() method, setting the channel id of all the frames sent to my channel id.
SEE ALSO
COPYRIGHT
Copyright (c) 2009 Eric Waters and XMission LLC (http://www.xmission.com/). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
AUTHOR
Eric Waters <ewaters@gmail.com>