NAME
RedisDB::Parse::Redis - redis protocol parser for RedisDB
SYNOPSIS
use RedisDB::Parse::Redis;
my $parser = RedisDB::Parse::Redis->new( redisdb => $ref );
$parser->add_callback(\&cb);
$parser->add($data);
DESCRIPTION
This module provides functions to build redis requests and parse replies from the server. Normally you don't want to use this module directly, see RedisDB instead.
METHODS
$self->new(redisdb => $redis, utf8 => $flag)
Creates new parser object. redisdb parameter points to the RedisDB object which owns this parser. The reference will be passed to callbacks as the first argument. utf8 flag may be set if you want all data encoded as UTF-8 before sending to server, and decoded when received.
$self->build_request($command, @arguments)
Encodes $command and @arguments as redis request.
$self->add_callback(\&cb)
Pushes callback to the queue of callbacks.
$self->set_default_callback(\&cb)
Set callback to invoke when there are no callbacks in queue. Used by subscription loop.
$self->callbacks
Returns true if there are callbacks in queue
$self->add($data)
Process new data received from the server. For every reply found callback from the queue will be invoked with two parameters -- reference to RedisDB object, and decoded reply from the server.
SEE ALSO
AUTHOR
Pavel Shaydo, <zwon at cpan.org>
LICENSE AND COPYRIGHT
Copyright 2011, 2012 Pavel Shaydo.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.