logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Redis::Sentinel - Redis Sentinel interface

Authors

       •   Pedro Melo <melo@cpan.org>

       •   Damien Krotkine <dams@cpan.org>

Constructor

new
       See "new" in Redis.pm. All parameters are supported, except "sentinels" and "service", which are silently
       ignored.

Description

       This is a subclass of the Redis module, specialized into connecting to a Sentinel instance. Inherits from
       the "Redis" package;

Methods

       All the methods of the "Redis" package are supported, plus the additional following methods:

   get_service_address
       Takes the name of a service as parameter, and returns either void (emptly list) if the master couldn't be
       found, the string 'IDONTKNOW' if the service is in the sentinel config but cannot be reached, or the
       string "$ip:$port" if the service were found.

   get_masters
       Returns a list of HashRefs representing all the master redis instances that this sentinel monitors.

Name

       Redis::Sentinel - Redis Sentinel interface

Synopsis

           my $sentinel = Redis::Sentinel->new( ... );
           my $service_address = $sentinel->get_service_address('mymaster');
           my @masters = $sentinel->get_masters;

Version

       version 2.000

See Also