AnyEvent-Redis-Federated
view release on metacpan or search on metacpan
lib/AnyEvent/Redis/Federated.pm view on Meta::CPAN
use warnings;
use AnyEvent::Redis;
use AnyEvent;
use Set::ConsistentHash; # for hash ring logic
use Digest::MD5 qw(md5); # for hashing keys
use Scalar::Util qw(weaken);
use List::Util qw(shuffle);
our $VERSION = "0.08";
# keep a global object cache that will contain weak references to
# objects keyed on their tag. this allows for sharing of objects
# within a given process by modules that are otherwise unaware of
# each other provided they use the same tag.
our %object_cache;
# These are all for failure handling (server down or unresponsive).
# If a connection to a given server fails, we'll retry up to
# MAX_HOST_RETRIES and then only retry once in a while. That
# interval is dictated by BASE_RETRY_INTERVAL. If that retry fails,
# we'll multiply that by RETRY_INTERVAL_MULT up to but not exceeding
( run in 1.170 second using v1.01-cache-2.11-cpan-49f99fa48dc )