Cache::Funky::Storage::Memcached - Cache::Funky Memcached Storage.
Memcached Storage for Cache::Funky
package MyCache; use strict; use Cache::Memcached; use base qw/Cache::Funky/; __PACKAGE__->setup('Storage::Memcached' => { servers => [ '127.0.0.1:12345' ] }); __PACKAGE__->register( 'foo', sub { time } ); __PACKAGE__->register( 'boo', sub { shift . '_' . `date` } ); # * date: $id + _Tue May 1 21:53:36 JST 2007 1;
run.pl
#!/usr/bin/perl use strict; use MyCache; use Perl6::Say; say ( MyCache->foo() ); sleep(3); say ( MyCache->foo() ); MyCache->delete('foo'); say ( MyCache->foo() ); say ( MyCache->boo('id1') ); say ( MyCache->boo('id2') ); sleep 10; say ( MyCache->boo('id1') ); # only remove id1 MyCache->delete('boo', 'id1'); say ( MyCache->boo('id1') ); say ( MyCache->boo('id2') ); MyCache->deletes([qw/foo boo/]);
Cache::Funky
Tomohiro Teranishi <tomohiro.teranishi@gmail.com>
Copyright (c) Tomohiro Teranishi, All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install Cache::Funky::Storage::Memcached, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Cache::Funky::Storage::Memcached
CPAN shell
perl -MCPAN -e shell install Cache::Funky::Storage::Memcached
For more information on module installation, please visit the detailed CPAN module installation guide.