Dave Rolsky > Crixa-0.10 > Crixa::Channel

Download:
Crixa-0.10.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.10   Source  

NAME ^

Crixa::Channel - A Crixa Channel

VERSION ^

version 0.10

DESCRIPTION ^

This class represents a channel. A channel is a lot like a socket. You will probably want to have a unique channel per process or thread for your application. You may also want to have separate channels for publishing and consuming messages.

It is safe (and encouraged) to keep the same channel open over a long period of time for publishing or consuming messages. There is no need to create new channels on a regular basis.

Also note that message delivery tags are scoped to the channel on which a message is delivered, and therefore message acks must go back to that same channel.

Channels are created by calling the Crixa->new_channel method.

METHODS ^

This class provides the following methods:

$channel->exchange(...)

This method creates a new Crixa::Exchange object. Any parameters passed to this method are passed directly to the Crixa::Exchange constructor, either as a hash or hashref. See the Crixa::Exchange documentation for more details.

$channel->queue(...)

This method creates a new Crixa::Queue object. Any parameters passed to this method are passed directly to the Crixa::Queue constructor, either as a hash or hashref. See the Crixa::Queue documentation for more details.

$channel->basic_qos(...)

This method sets quality of service flags for the channel. This method takes a hash or hash reference with the following keys:

Note that prefetching messages is only done when the queue is created in "no ack" mode (or "auto ack" if you prefer to think of it that way).

$channel->ack(...)

This method acknowledges delivery of a message received on this channel.

It accepts two positional arguments. The first is the delivery tag for the message, which is required. The second is the "multiple" flag. If this is true, it means that you are acknowledging all messages up to the given delivery tag. It defaults to false.

$channel->id

This returns the channel's unique id. This is a positive integer.

Crixa::Channel->new(...)

Don't call this method directly. Instead, call new_channel on a connected Crixa object.

AUTHORS ^

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2012 - 2014 by Chris Prather.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: