AnyEvent-RipeRedis
view release on metacpan or search on metacpan
Changes
examples/eval.pl
examples/generic.pl
examples/subs.pl
examples/unix_socket.pl
lib/AnyEvent/RipeRedis.pm
lib/AnyEvent/RipeRedis/Error.pm
Makefile.PL
MANIFEST This list of files
README.md
t/00-base.t
t/01-error-codes.t
t/02-accessors.t
t/03-auth.t
t/04-commands.t
return;
}
# reply handling...
}
);
# CONNECTION VIA UNIX-SOCKET
Redis 2.2 and higher support connection via UNIX domain socket. To connect via
a UNIX-socket in the parameter `host` you have to specify `unix/`, and in
the parameter `port` you have to specify the path to the socket.
my $redis = AnyEvent::RipeRedis->new(
host => 'unix/',
port => '/tmp/redis.sock',
);
# LUA SCRIPTS EXECUTION
Redis 2.6 and higher support execution of Lua scripts on the server side.
To execute a Lua script you can send one of the commands `EVAL` or `EVALSHA`,
or use the special method `eval_cached()`.
## eval\_cached( $script, $keys\_num \[, @keys \] \[, @args \] \[, $cb->( $reply, $err ) \] \] );
examples/unix_socket.pl view on Meta::CPAN
use strict;
use warnings;
use AnyEvent;
use AnyEvent::RipeRedis;
my $cv = AE::cv;
my $redis;
$redis = AnyEvent::RipeRedis->new(
host => 'unix/',
port => '/var/run/redis/redis.sock',
password => 'redis_pass',
connection_timeout => 5,
read_timeout => 5,
reconnect_interval => 5,
on_connect => sub {
print "Connected to Redis server\n";
},
lib/AnyEvent/RipeRedis.pm view on Meta::CPAN
return;
}
# reply handling...
}
);
=head1 CONNECTION VIA UNIX-SOCKET
Redis 2.2 and higher support connection via UNIX domain socket. To connect via
a UNIX-socket in the parameter C<host> you have to specify C<unix/>, and in
the parameter C<port> you have to specify the path to the socket.
my $redis = AnyEvent::RipeRedis->new(
host => 'unix/',
port => '/tmp/redis.sock',
);
=head1 LUA SCRIPTS EXECUTION
Redis 2.6 and higher support execution of Lua scripts on the server side.
To execute a Lua script you can send one of the commands C<EVAL> or C<EVALSHA>,
or use the special method C<eval_cached()>.
=head2 eval_cached( $script, $keys_num [, @keys ] [, @args ] [, $cb->( $reply, $err ) ] ] );
t/tlib/Test/RedisRunner.pm view on Meta::CPAN
unless ( defined $params{tmpdir} ) {
$params{tmpdir} = File::Temp->newdir( CLEANUP => 1 );
}
$self->{tmpdir} = $params{tmpdir};
$self->{_owner_pid} = $$;
my $tmpdir = $self->{tmpdir};
my $conf = $self->{conf};
unless ( defined $conf->{port} || defined $conf->{unixsocket} ) {
$conf->{unixsocket} = $tmpdir . '/redis.sock';
$conf->{port} = '0';
}
unless ( defined $conf->{dir} ) {
$conf->{dir} = "$tmpdir/";
}
if ( $conf->{loglevel} && $conf->{loglevel} eq 'warning' ) {
warn "Test::RedisRunner does not support \"loglevel warning\","
. " using \"notice\" instead.\n";
$conf->{loglevel} = 'notice';
}
t/tlib/Test/RedisRunner.pm view on Meta::CPAN
}
sub connect_info {
my $self = shift;
my $conf = $self->{conf};
my $host = $conf->{bind} || '0.0.0.0';
my $port = $conf->{port};
if ( !$port || $port == 0 ) {
$host = 'unix/';
$port = $conf->{unixsocket};
}
return (
host => $host,
port => $port,
);
}
sub _conf_string {
my $self = shift;
( run in 1.104 second using v1.01-cache-2.11-cpan-39bf76dae61 )