Protocol::Redis::Faster - Optimized pure-perl Redis protocol parser/encoder
use Protocol::Redis::Faster; my $redis = Protocol::Redis::Faster->new(api => 1) or die "API v1 not supported"; $redis->parse("+foo\r\n"); # get parsed message my $message = $redis->get_message; print "parsed message: ", $message->{data}, "\n"; # asynchronous parsing interface $redis->on_message(sub { my ($redis, $message) = @_; print "parsed message: ", $message->{data}, "\n"; }); # parse pipelined message $redis->parse("+bar\r\n-error\r\n"); # create message print "Get key message:\n", $redis->encode({type => '*', data => [ {type => '$', data => 'string'}, {type => '+', data => 'OK'} ]});
This module implements the Protocol::Redis API with more optimized pure-perl internals. See Protocol::Redis for usage documentation.
This is a low level parsing module, if you are looking to use Redis in Perl, try Redis, Redis::hiredis, or Mojo::Redis.
Report any issues on the public bugtracker.
Dan Book <dbook@cpan.org>
Jan Henning Thorsen <jhthorsen@cpan.org>
Thanks to Sergey Zasenko <undef@cpan.org> for the original Protocol::Redis and defining the API.
This software is Copyright (c) 2019 by Dan Book, Jan Henning Thorsen.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
Protocol::Redis
To install Protocol::Redis::Faster, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Protocol::Redis::Faster
CPAN shell
perl -MCPAN -e shell install Protocol::Redis::Faster
For more information on module installation, please visit the detailed CPAN module installation guide.