Peter Karman > Dezi-Bot-0.002 > Dezi::Bot::Cache

Download:
Dezi-Bot-0.002.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.002   Source   Latest Release: Dezi-Bot-0.003

NAME ^

Dezi::Bot::Cache - web crawler cache

SYNOPSIS ^

 use Dezi::Bot::Cache;

 my $cache = Dezi::Bot::Cache->new(%chi_params);
 $cache->add( foo => 'bar' );
 $cache->has( 'foo' );    # returns true
 $cache->get( 'foo' );    # returns 'bar'
 $cache->delete( 'foo' ); # removes 'foo' from cache and returns 1

DESCRIPTION ^

The Dezi::Bot::Cache module conforms to the SWISH::Prog::Cache API but delegates all caching to CHI.

METHODS ^

new( chi_params )

Returns instance of Dezi::Bot::Cache, initializing the internal CHI object with chi_params.

If empty, chi_params defaults to:

 %chi_params = (
   driver    => 'File',
   root_dir  => '/tmp/dezibot',
   namespace => 'dezibot',
 );

chi

Returns the internal CHI object.

add( key, value [, expires] )

Add key value pair to cache, optional expires setting. See CHI for expires documentation.

has( key )

Returns true if key is in the cache and has not expired.

get( key )

Returns value for key or undef if key is not present or has expired.

delete( key )

Removes key from the cache.

AUTHOR ^

Peter Karman, <karman at cpan.org>

BUGS ^

Please report any bugs or feature requests to bug-dezi-bot at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dezi-Bot. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Dezi::Bot

You can also look for information at:

COPYRIGHT & LICENSE ^

Copyright 2013 Peter Karman.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: