Redis::Sentinel(3pm)

πŸ“¦
version 2.000 Β· 7 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Redis::Sentinel β€” bestie, it's the Redis Sentinel interface πŸŽ€


✨ VERSION ✨

version 2.000 β€” yes queen, that's the one 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the whole vibe in like four lines:

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

🌈 DESCRIPTION 🌈

So this is a subclass of the Redis module, but like, specialized πŸ’… β€” it's built for connecting to a Sentinel instance specifically. It inherits from the "Redis" package, no cap. 🫢


πŸŽ€ CONSTRUCTOR πŸŽ€

🌸 new

Go look at "new" in Redis.pm for the details, bestie. All parameters are supported, except for "sentinels" and "service" β€” those two get silently ignored πŸ™ˆ (like, they just don't do anything, no warning, nothing).


πŸ’… METHODS πŸ’…

Every single method from the "Redis" package is supported πŸ‘‘ plus these extra ones below:

🌟 get_service_address

Takes the name of a service as its parameter, and gives you back one of three things:

  • void (that's an empty list, okay) if the master couldn't be found 😭
  • the string 'IDONTKNOW' if the service is in the sentinel config but cannot be reached πŸ’€
  • the string "$ip:$port" if the service was found β€” slay ✨

🌟 get_masters

Returns a list of HashRefs representing all the master redis instances that this sentinel monitors. That's it, that's the whole thing πŸ¦‹


🫢 AUTHORS 🫢

  • Pedro Melo <melo@cpan.org>
  • Damien Krotkine <dams@cpan.org>

This software is Copyright (c) 2015 by Pedro Melo, Damien Krotkine.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

and that's the whole page, bestie, periodt πŸ’–

okay so the tiny fine print down here says this is perl v5.36.0, dated 2023-01-14, and it's the Redis::Sentinel(3pm) page β€” love that for us πŸŽ€βœ¨πŸŒΈ

πŸ“¦ where this page comes from