AnyEvent-RipeRedis-Cluster
view release on metacpan or search on metacpan
If the password is specified, the `AUTH` command is sent to all nodes
of the cluster after connection.
- allow\_slaves => $boolean
If enabled, the client will try to send read-only commands to slave nodes.
Disabled by default.
- utf8 => $boolean
If enabled, all strings will be converted to UTF-8 before sending to nodes,
and all results will be decoded from UTF-8.
Enabled by default.
- connection\_timeout => $fractional\_seconds
Specifies connection timeout. If the client could not connect to the node
after specified timeout, the `on_node_error` callback is called with the
lib/AnyEvent/RipeRedis/Cluster.pm view on Meta::CPAN
$self->{allow_slaves} = $params{allow_slaves};
$self->{lazy} = $params{lazy};
$self->refresh_interval( $params{refresh_interval} );
$self->{on_node_connect} = $params{on_node_connect};
$self->{on_node_disconnect} = $params{on_node_disconnect};
$self->{on_node_error} = $params{on_node_error};
$self->on_error( $params{on_error} );
my %node_params;
foreach my $name ( qw( password utf8 connection_timeout read_timeout
reconnect reconnect_interval handle_params ) )
{
next unless defined $params{$name};
$node_params{$name} = $params{$name};
}
$self->{_node_params} = \%node_params;
$self->_reset_internals;
$self->{_input_queue} = [];
$self->{_temp_queue} = [];
lib/AnyEvent/RipeRedis/Cluster.pm view on Meta::CPAN
};
}
}
return $self->{on_error};
}
sub crc16 {
my $data = shift;
unless ( utf8::downgrade( $data, 1 ) ) {
utf8::encode($data);
}
my $crc = 0;
foreach my $char ( split //, $data ) {
$crc = ( $crc << 8 & 0xff00 )
^ $CRC16_TAB[ ( ( $crc >> 8 ) ^ ord($char) ) & 0x00ff ];
}
return $crc;
}
lib/AnyEvent/RipeRedis/Cluster.pm view on Meta::CPAN
If the password is specified, the C<AUTH> command is sent to all nodes
of the cluster after connection.
=item allow_slaves => $boolean
If enabled, the client will try to send read-only commands to slave nodes.
Disabled by default.
=item utf8 => $boolean
If enabled, all strings will be converted to UTF-8 before sending to nodes,
and all results will be decoded from UTF-8.
Enabled by default.
=item connection_timeout => $fractional_seconds
Specifies connection timeout. If the client could not connect to the node
after specified timeout, the C<on_node_error> callback is called with the
( run in 1.166 second using v1.01-cache-2.11-cpan-49f99fa48dc )