The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Catalyst::Model::CacheFunky::Loader - Load Cache::Funky Modules.

SYNOPSYS

 package 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' => {} } ,
    mrr_args         => { path => '/var/www/Common/lib/' } , # option. SEE L<Module::Recursive::Require> new(\%args) 
 );

 1;

 package MyApp::CacheFunky::Foo;

 use strict;
 use warnings;
 use qw/Cache::Funky/;
 
 __PACKAGE__->register( 'foo' , sub { `date`} );

 1;


 package MyAPpCacheFunky::Users;

 use strict;
 use warnings;
 use qw/Cache::Funky/;

 __PACKAGE__->register( 'user_count' , sub { __PACKAGE__->context()->model('DB::Users')->count(); } );

 1;



 package 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() );
 }

 1;

 [% c.forwrd('Model::Funky' ,'foo' ) %]

DESCRIPTION

Load Cache::Funky modules and make them ready for you.

METHOD

new

SEE ALSO

Module::Recursive::Require

AUTHOR

Tomohiro Teranishi <tomohiro.teranishi@gmail.com>