[Catalyst] porting C::FastMmap to use Cache::Cache

Sebastian Riedel sri at oook.de
Sun Mar 13 01:06:33 CET 2005


toddrw69 at excite.com wrote:

>I prefer a store other than memory, so if mysql is better than the memory cache thats what I'll use.
>  
>
Mmap is not storing it in memory, it uses an mmap'ed file.

>But I still need some test code so I know when its ported :(
>  
>
Just create a small application using sessions.

    catalyst.pl MyApp
    cd MyApp

Modify lib/MyApp.pm like this.

    use Catalyst qw/-Debug Session::FastMmap/;

    MyApp->action(

        '!begin' => sub {
            my ( $self, $c ) = @_;
            $c->log->debug( $c->session->{foo} ? "exists" : "doesn't 
exist" );
            $c->session->{foo} ||= 'bar';
        }

    );

And run it.

    script/server.pl

The log should say "exists" after the second request, otherwise you 
broke it. :)

--
sebastian



More information about the Catalyst mailing list