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

NAME

Cache::Memory::Simple - Yet another on memory cache

SYNOPSIS

use Cache::Memory::Simple;
use feature qw/state/;

sub get_stuff {
    my ($class, $key) = @_;

    state $cache = Cache::Memory::Simple->new();
    $cache->get_or_set(
        $key, sub {
            Storage->get($key) # slow operation
        }, 10 # cache in 10 seconds
    );
}

DESCRIPTION

Cache::Memory::Simple is yet another on memory cache implementation.

METHODS

AUTHOR

Tokuhiro Matsuno

SEE ALSO

LICENSE

Copyright (C) Tokuhiro Matsuno

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.