GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DocSet::Cache(3) User Contributed Perl Documentation DocSet::Cache(3)

"DocSet::Cache" - Maintain a Non-Volatile Cache of DocSet's Data

  use DocSet::Cache ();

  my $cache = DocSet::Cache->new($cache_path, 1);

  # $cache->read; # read by new() already
  $cache->write;

  # add a cache item to the ordered list
  $cache->add($id);

  # set/unset cached item's attributes
  $cache->set($id, $attr, $data);
  $cache->unset($id, $attr)

  # get cached item's attributes
  my $data = $cache->get($id, $attr);
  print "$id is cached" if $cache->is_cached($id);

  # invalidate cache (deletes all items)
  $cache->invalidate();

  my $seq = $cache->id2seq($id);
  my $id = $cache->seq2id($seq);
  my @ids = $cache->ordered_ids;
  my $total_ids = $cache->total_ids;

  $cache->index_node(
      id       => $id,
      stitle   => $stitle,
      title    => $title,
      abstract => $abstract,
      #...
  );
  my %index_node = $cache->index_node();

  $cache->parent_node($cache_path, $id, $rel_path);
  my ($cache_path, $id, $rel_path) = $cache->parent_node();

"DocSet::Cache" maintains a non-volatile cache of docset's data.

The cache is initialized either from the freezed file at the provided path. When the file is empty or doesn't exists, a new cache is initialized. When the cache is modified it should be saved, but if for some reason it doesn't get saved, the "DESTROY" method will check whether the cache wasn't synced to the disk yet and will perform the sync itself.

Each docset's node can create an entry in the cache, and store its data in it. The creator has to ensure that it supplies a unique id for each node that is added. Cache's internal representation is a hash, with internal data keys starting with _ (underscore), therefore the only restriction on node's id value is that it shouldn't not start with underscore.

META: to be written (see SYNOPSIS meanwhile)

Stas Bekman <stas (at) stason.org>
2005-09-02 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.