AnyEvent-Redis-RipeRedis

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

Changes
examples/eval.pl
examples/generic.pl
examples/subs.pl
examples/unix_socket.pl
lib/AnyEvent/Redis/RipeRedis.pm
Makefile.PL
MANIFEST
README
t/00-base.t
t/01-accessors.t
t/02-error-codes.t
t/03-auth.t
t/04-commands.t
t/05-db-select.t

examples/unix_socket.pl  view on Meta::CPAN

use strict;
use warnings;

use AnyEvent;
use AnyEvent::Redis::RipeRedis;

my $cv = AE::cv();

my $redis;
$redis = AnyEvent::Redis::RipeRedis->new(
  host                   => 'unix/',
  port                   => '/var/run/redis/redis.sock',
  password               => 'redis_pass',
  connection_timeout     => 5,
  read_timeout           => 5,
  min_reconnect_interval => 5,

  on_connect => sub {
    print "Connected to Redis server\n";
  },

lib/AnyEvent/Redis/RipeRedis.pm  view on Meta::CPAN

operation was completed successfully or when unsubscription operation fails.
In first case C<on_reply> callback is called on every specified pattern.
Information about channel pattern and number of remaining subscriptions is
passed to callback in first argument as an array reference.

=back

=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::Redis::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, $numkeys [, @keys ] [, @args ] [, $cb | \%cbs ] );

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.773 second using v1.01-cache-2.11-cpan-39bf76dae61 )