NAME
Catalyst::Model::CacheFunky::Loader - Load Cache::Funky Modules.
SYNOPSYS
MyApp::Model::Funky;
use strict;
use warnings;
use base qw/Catalyst::Model::CacheFunky::Loader/;
__PACKAGE__->config(
class => 'MyApp::CacheFunky', # read all module under MyApp::CacheFunky::*
initialize_info => { 'Storage::Simple' => {} } ,
);
1;
MyApp::CacheFunky::Foo;
use strict;
use warnings;
use qw/Cache::Funky/;
__PACKAGE__->register( 'foo' , sub { `date`} );
1;
MyAPpCacheFunky::Users;
use strict;
use warnings;
use qw/Cache::Funky/;
__PACKAGE__->register( 'user_count' , sub { __PACKAGE__->context()->model('DB::Users')->count(); } );
1;
MyApp::Controller::FooBar;
sub foo : Local {
my ( $s ,$c ) = @_;
$c->log->debug( $c->model('Funky::Foo')->foo() );
sleep(1);
$c->log->debug( $c->model('Funky::Foo')->foo() );
sleep(1);
$c->model('Funky::Foo')->delete('foo');
$c->log->debug( $c->model('Funky::Foo')->foo() );
}
DESCRIPTION
Load Cache::Funky modules and make them ready for you.
METHOD
new
SEE ALSO
AUTHOR
Tomohiro Teranishi <tomohiro.teranishi@gmail.com>