<html><head><title>CHI::Driver::FastMmap</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" > <link rel="stylesheet" type="text/css" title="pod_stylesheet" href="http://search.cpan.org/s/style.css"> </head> <body class='pod'> <!-- generated by Pod::Simple::HTML v3.15, using Pod::Simple::PullParser v3.15, under Perl v5.012002 at Wed Mar 2 00:52:12 2011 GMT. If you want to change this HTML document, you probably shouldn't do that by changing it directly. Instead, see about changing the calling options to Pod::Simple::HTML, and/or subclassing Pod::Simple::HTML, then reconverting this document from the Pod source. When in doubt, email the author of Pod::Simple::HTML for advice. See 'perldoc Pod::Simple::HTML' for more info. --> <!-- start doc --> <a name='___top' class='dummyTopAnchor' ></a> <div class='indexgroup'> <ul class='indexList indexList1'> <li class='indexItem indexItem1'><a href='#NAME'>NAME</a> <li class='indexItem indexItem1'><a href='#SYNOPSIS'>SYNOPSIS</a> <li class='indexItem indexItem1'><a href='#REQUIREMENTS'>REQUIREMENTS</a> <li class='indexItem indexItem1'><a href='#DESCRIPTION'>DESCRIPTION</a> <li class='indexItem indexItem1'><a href='#CONSTRUCTOR_OPTIONS'>CONSTRUCTOR OPTIONS</a> <li class='indexItem indexItem1'><a href='#METHODS'>METHODS</a> </ul> </div> <h1><a class='u' href='#___top' title='click to go to top of document' name="NAME" >NAME</a></h1> <p>CHI::Driver::FastMmap - Shared memory interprocess cache via mmap'ed files</p> <h1><a class='u' href='#___top' title='click to go to top of document' name="SYNOPSIS" >SYNOPSIS</a></h1> <pre> use CHI; my $cache = CHI->new( driver => 'FastMmap', root_dir => '/path/to/cache/root', cache_size => '1m' );</pre> <h1><a class='u' href='#___top' title='click to go to top of document' name="REQUIREMENTS" >REQUIREMENTS</a></h1> <p>You will need to install <a href="http://search.cpan.org/perldoc?Cache%3A%3AFastMmap" class="podlinkpod" >Cache::FastMmap</a> from CPAN to use this driver.</p> <h1><a class='u' href='#___top' title='click to go to top of document' name="DESCRIPTION" >DESCRIPTION</a></h1> <p>This cache driver uses Cache::FastMmap to store data in an mmap'ed file. It is very fast, and can be used to share data between processes on a single host, though not between hosts.</p> <p>To support namespaces, this driver takes a directory parameter rather than a file, and creates one Cache::FastMMap file for each namespace.</p> <p>Because CHI handles serialization automatically, we pass the <code>raw_values</code> flag as 1; and to conform to the CHI API, we pass <code>unlink_on_exit</code> as 0, so that all cache files are permanent.</p> <h1><a class='u' href='#___top' title='click to go to top of document' name="CONSTRUCTOR_OPTIONS" >CONSTRUCTOR OPTIONS</a></h1> <dl> <dt><a name="root_dir" >root_dir</a></dt> <dd> <p>Path to the directory that will contain the share files, one per namespace. Defaults to a directory called 'chi-driver-fastmmap' under the OS default temp directory (e.g. '/tmp' on UNIX).</p> <dt><a name="dir_create_mode" >dir_create_mode</a></dt> <dd> <p>Permissions mode to use when creating directories. Defaults to 0775.</p> </dd> </dl> <p>Any other constructor options <a href="http://search.cpan.org/perldoc?CHI#constructor" class="podlinkpod" >not recognized by CHI</a> are passed along to <a href="http://search.cpan.org/perldoc?Cache%3A%3AFastMmap-%3Enew" class="podlinkpod" >Cache::FastMmap->new</a>.</p> <h1><a class='u' href='#___top' title='click to go to top of document' name="METHODS" >METHODS</a></h1> <dl> <dt><a name="fm_cache" >fm_cache</a></dt> <dd> <p>Returns a handle to the underlying Cache::FastMmap object. You can use this to call FastMmap-specific methods that are not supported by the general API, e.g.</p> <pre> $self->fm_cache->get_and_set("key", sub { ... });</pre> </dd> </dl> <!-- end doc --> </body></html>