Arch::SharedCache(3pm)

Arch::SharedCache3pm

A synchronized data structure (map) for ipc

Usage

    use Arch::SharedCache;
    my $cache = Arch::SharedCache->new(
        dir => '/tmp/dir-listings',
        max_size   => 100,
        expiration => 600,  # 10 minutes
    );
    sub ls_long { scalar `ls -l $_[0]` }
    my $user_dir = '/usr/share';
    $cache->store($user_dir => ls_long($user_dir));
    $cache->fetch_store(sub { ls_long($_[0]) }, qw(/tmp /bin /usr/share));
    printf "Cached listing of $user_dir:\n%s", $cache->fetch($user_dir);
    $cache->delete($user_dir);
    # examine /tmp/dir-listings/ after running this script
    # see also synopsys of Arch::SharedIndex

Overview

Arch::SharedCache provides an Arch::SharedIndex implementation using a single file per value.

Methods

The following methods are available:

new.

Other methods are documented in Arch::SharedIndex.

new options

Create a new Arch::SharedCache object. options is a hash of options.

dir

The cache directory used to store data. Will be created if it doesn't exist.

index_file

Name of the index file for the cache. Defaults to "dir/.index".

Releases

8 releases since Debian 4.0 (Etch); the text changed 3 times.

  1. 4.0
  2. 5.0
  3. 6.0–8
  4. 9–11

Bugs

Awaiting for your reports.

Authors

Mikhael Goikhman ([email protected]/arch-perl--devel).

Enno Cramer ([email protected]/arch-perl--devel).

From libarch-perl 0.5.2-2 in Debian 11 (Bullseye). Parsed by carta from the page's man source.