Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > c575b3572b1a595b8b6ae0529951ea8a > files > 12

perl-CHI-0.44-3.fc14.noarch.rpm

<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&#39;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-&#62;new(
        driver     =&#62; &#39;FastMmap&#39;,
        root_dir   =&#62; &#39;/path/to/cache/root&#39;,
        cache_size =&#62; &#39;1m&#39;
    );</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&#39;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 &#39;chi-driver-fastmmap&#39; under the OS default temp directory (e.g. &#39;/tmp&#39; 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-&#62;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-&#62;fm_cache-&#62;get_and_set(&#34;key&#34;, sub { ... });</pre>
</dd>
</dl>

<!-- end doc -->

</body></html>