Tomas Doran > AnyEvent-RabbitMQ-1.08 > AnyEvent::RabbitMQ::Channel

Download:
AnyEvent-RabbitMQ-1.08.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  4
Open  3
Stalled  1
View/Report Bugs
Module Version: 1.08   Source   Latest Release: AnyEvent-RabbitMQ-1.16

NAME ^

AnyEvent::RabbitMQ::Channel - Abstraction of an AMQP channel.

SYNOPSIS ^

    my $ch = $rf->open_channel();
    $ch->declare_exchange(exchange => 'test_exchange');

DESCRIPTION ^

METHODS ^

declare_exchange (%args)

Declare an exchange (to publish messages to) on the server.

Arguments:

on_success
on_failure
type

Default 'direct'

passive

Default 0

durable

Default 0

auto_delete

Default 0

internal

Default 0

exchange

The name of the exchange

delete_exchange

declare_queue

bind_queue

Binds a queue to an exchange, with a routing key.

Arguments:

queue

The name of the queue to bind

exchange

The name of the exchange to bind

routing_key

The routing key to bind with

unbind_queue

purge_queue

Flushes the contents of a queue.

delete_queue

Deletes a queue. The queue may not have any active consumers.

publish

Publish a message to an exchange

Arguments:

body

The text body of the message to send.

exchange

The name of the exchange to send the message to.

routing_key

The routing key with which to publish the message.

consume

Subscribe to consume messages from a queue.

Arguments:

on_consume

Callback called with an argument of the message which has been consumed.

consumer_tag

Identifies this consumer, will be auto-generated if you do not provide it, but you must supply a value if you want to be able to later cancel the subscription.

on_success

Callback called if the subscription was successful (before the first message is consumed).

on_failure

Callback called if the subscription fails for any reason.

cancel

Cancel a queue subscription.

Note that the cancellation will not take place at once, and further messages may be consumed before the subscription is cancelled. No further messages will be consumed after the on_success callback has been called.

Arguments:

consumer_tag

Identifies this consumer, needs to be the value supplied when the queue is initially consumed from.

on_success

Callback called if the subscription was successfully cancelled.

on_failure

Callback called if the subscription could not be cancelled for any reason.

get

Try to get a single message from a queue.

Arguments:

queue

Mandatory. Name of the queue to try to receive a message from.

on_success

Will be called either with either a message, or, if the queue is empty, a notification that there was nothing to collect from the queue.

on_failure

This callback will be called if an error is signalled on this channel.

ack

qos

recover

select_tx

commit_tx

rollback_tx

AUTHOR, COPYRIGHT AND LICENSE ^

See AnyEvent::RabbitMQ for author(s), copyright and license.

syntax highlighting: