Net::Async::Memcached - basic IO::Async support for memcached
version 0.001
use strict; use warnings; use IO::Async::Loop; use Net::Async::Memcached::Client; my $loop = IO::Async::Loop->new; # Will begin connection immediately on instantiation $mc = Net::Async::Memcached::Client->new( host => 'localhost', # this is the default loop => $loop, on_connected => sub { my $mc = shift; my ($k, $v) = qw(hello world); $mc->set( $k => $v, on_complete => sub { $mc->get( $k, on_complete => sub { my %args = @_; print "Value stored was " . $args{value} . "\n"; $loop->later(sub { $loop->loop_stop }); }, on_error => sub { die "Failed because of @_\n" } ); } ); } );
Provides basic memcached support - see Protocol::Memcached for a list of available methods.
This is the parent class used by Net::Async::Memcached::Client and Net::Async::Memcached::Server.
Accessor for internal IO::Async::Stream object representing the underlying memcached transport.
Proxies a Protocol::Memcached write request to the underlying transport.
write
Accessor for the service information - this is the port or service name we will attempt to connect to or listen on.
service
There's a list of alternative memcached modules in "SEE ALSO" in Protocol::Memcached.
Tom Molesworth <cpan@entitymodel.com>
Copyright Tom Molesworth 2011. Licensed under the same terms as Perl itself.
To install Net::Async::Memcached, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Async::Memcached
CPAN shell
perl -MCPAN -e shell install Net::Async::Memcached
For more information on module installation, please visit the detailed CPAN module installation guide.