| Cache::Memcached::AnyEvent - AnyEvent Compatible Memcached Client |
new(%args)connect()disconnect()protocol($object)protocol_class($class)servers()
Cache::Memcached::AnyEvent - AnyEvent Compatible Memcached Client
use Cache::Memcached::AnyEvent;
my $memd = Cache::Memcached::AnyEvent->new({
servers => [ '127.0.0.1:11211' ],
compress_threshold => 10_000,
namespace => 'myapp.',
});
$memd->get( $key, sub {
my ($value) = @_;
warn "got $value for $key";
});
$memd->disconnect();
WARNING: ALPHA QUALITY CODE!
This module implements the memcached protocol as a AnyEvent consumer, and it implments both for text and binary protocols.
There's another alternative AnyEvent memcached client, the AnyEvent::Memcached manpage which is perfectly fine, and I have nothing against you using that module, but I had specific itches to scratch:
This module, the Cache::Memcached::AnyEvent manpage, requires the bare minimum prerequisites to install.
There were more than a few modules that get installed for the AnyEvent::Memcached manpage (including some modules that I had to install solely for it) and I wanted to avoid it.
I was in the mood to implement the binary protocol. I don't believe it's a requirement to do anything, so this is purely a whim.
get_multi and the like are not implemented yet on the AnyEvent::Memcached manpage.
new(%args)Set to 0 to disable auto-reconnecting
Specify hashing coderef. Callback must return an index to the list of the servers, where $key belongs to.
Amount of time to wait between reconnect attempts
List of servers to use.
%args can also be a hashref.
connect()Explicitly connects to each server given. You DO NOT need to call this explicitly.
disconnect()
protocol($object)
protocol_class($class)
Alias to delete
servers()
Daisuke Maki <daisuke@endeworks.jp>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
| Cache::Memcached::AnyEvent - AnyEvent Compatible Memcached Client |