NAME

Net::MemcacheQ

VERSION

$LastChangedRevision$

SYNOPSIS

my $oNMQ = Net::MemcacheQ->new({
  host => '192.168.0.1',
  port => 22202,
});

$oNMQ->push('myqueue', '{"some data":"abcdefg"}');

my $message = $oNMQ->shift('myqueue');

DESCRIPTION

MemcacheQ implements a BerkeleyDB-backed FIFO message queue service serviced using the Memcache protocol. Net::MemcacheQ provides a simple interface against a single memcacheq instance.

For more information about MemcacheQ, please see: http://memcachedb.org/memcacheq/

SUBROUTINES/METHODS

new - constructor

my $oNMQ = Net::MemcacheQ->new({...});

Optional arguments:
host => 'localhost'  # memcacheq server hostname
port => 22201        # memcacheq server port

queues - arrayref of queue names

my $arQueueNames = $oNMQ->queues();

delete_queue - delete a queue, messages and all

$oNMQ->delete_queue($sQueueName);

push - push a message onto a given queue

$oNMQ->push($sQueueName, $sQueueMessage);

shift - pull a message from a given queue

my $sMessage = $oNMQ->shift($sQueueName);

DESTROY - disconnect socket on destruction

DIAGNOSTICS

CONFIGURATION AND ENVIRONMENT

Debugging messages are available by setting:

$Net::MemcacheQ::DEBUG = $Net::MemcacheQ::DEBUG_INFO;

DEPENDENCIES

strict
warnings
IO::Socket::INET
Readonly
Carp
English -no_match_vars

INCOMPATIBILITIES

BUGS AND LIMITATIONS

See those of memcacheq, in particular about message size.

AUTHOR

$Author: Roger Pettett$

LICENSE AND COPYRIGHT

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.