Permalink
Browse files

documentation

  • Loading branch information...
1 parent 6da5c13 commit e0d1e57aa6f71d7fe0ccb922ed4c6992e183f797 @dams dams committed Jan 12, 2014
Showing with 42 additions and 0 deletions.
  1. +4 −0 lib/Redis.pm
  2. +38 −0 lib/Redis/Sentinel.pm
View
@@ -1729,6 +1729,10 @@ Ulrich Habel
Ivan Kruglov
+=item *
+
+Steffen Mueller <smueller@cpan.org>
+
=back
=cut
View
@@ -32,3 +32,41 @@ sub get_masters {
}
1;
+
+__END__
+
+=head1 SYNOPSIS
+
+ my $sentinel = Redis::Sentinel->new( ... );
+ my $service_address = $sentinel->get_service_address('mymaster');
+ my @masters = $sentinel->get_masters;
+
+=head1 DESCRIPTION
+
+This is a subclass of the Redis module, specialized into connecting to a
+Sentinel instance. Inherits from the C<Redis> package;
+
+=head1 CONSTRUCTOR
+
+=head2 new
+
+See C<new> in L<Redis.pm>. All parameters are supported, except C<sentinels>
+and C<service>, which are silently ignored.
+
+=head1 METHODS
+
+All the methods of the C<Redis> package are supported, plus the aditional following methods:
+
+=head2 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 C<"$ip:$port"> if the
+service were found.
+
+=head2 get_masters
+
+Returns a list of HashRefs representing all the master redis instances that
+this sentinel monitors.
+
+=cut

0 comments on commit e0d1e57

Please sign in to comment.