Net::MemcacheQ
$LastChangedRevision$
my $oNMQ = Net::MemcacheQ->new({ host => '192.168.0.1', port => 22202, }); $oNMQ->push('myqueue', '{"some data":"abcdefg"}'); my $message = $oNMQ->shift('myqueue');
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/
my $oNMQ = Net::MemcacheQ->new({...}); Optional arguments: host => 'localhost' # memcacheq server hostname port => 22201 # memcacheq server port
my $arQueueNames = $oNMQ->queues();
$oNMQ->delete_queue($sQueueName);
$oNMQ->push($sQueueName, $sQueueMessage);
my $sMessage = $oNMQ->shift($sQueueName);
Debugging messages are available by setting:
$Net::MemcacheQ::DEBUG = $Net::MemcacheQ::DEBUG_INFO;
See those of memcacheq, in particular about message size.
$Author: Roger Pettett$
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/>.
To install Net::MemcacheQ, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::MemcacheQ
CPAN shell
perl -MCPAN -e shell install Net::MemcacheQ
For more information on module installation, please visit the detailed CPAN module installation guide.