CHI::Driver::RawMemory man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

CHI::Driver::RawMemoryUser Contributed Perl DocumentaCHI::Driver::RawMemory(3)

NAME
       CHI::Driver::RawMemory - In-process memory cache that stores direct
       references

VERSION
       version 0.55

SYNOPSIS
	   use CHI;

	   my $hash = {};
	   my $cache = CHI->new( driver => 'RawMemory', datastore => $hash );

	   my $cache = CHI->new( driver => 'RawMemory', global => 1 );

DESCRIPTION
       This is a subclass of CHI::Driver::Memory that stores references to
       data structures directly instead of serializing / deserializing.	 This
       makes the cache faster at getting and setting complex data structures,
       but unlike most drivers, modifications to the original data structure
       will affect the data structure stored in the cache, and vica versa.
       e.g.

	   my $cache = CHI->new( driver => 'Memory', global => 1 );
	   my $lst = ['foo'];
	   $cache->set('key' => $lst);	 # serializes $lst before storing
	   $cache->get('key');	 # returns ['foo']
	   $lst->[0] = 'bar';
	   $cache->get('key');	 # returns ['foo']

	   my $cache = CHI->new( driver => 'RawMemory', global => 1 );
	   my $lst = ['foo'];
	   $cache->set('key' => $lst);	 # stores $lst directly
	   $cache->get('key');	 # returns ['foo']
	   $lst->[0] = 'bar';
	   $cache->get('key');	 # returns ['bar']!

CONSTRUCTOR OPTIONS
       Same as CHI::Driver::Memory.

SIZE AWARENESS
       For the purpose of size-awareness, all items count as size 1 for this
       driver. (Because data structures are not serialized, there's no good
       way to determine their size.)

	   # Keep a maximum of 10 items in cache
	   #
	   my $cache = CHI->new( driver => 'RawMemory', datastore => {}, max_size => 10 );

ACKNOWLEDGEMENTS
       Thanks to Yuval Kogman whose Cache::Ref inspired me to do this.

SEE ALSO
       CHI::Driver::Memory, CHI

AUTHOR
       Jonathan Swartz <swartz@pobox.com>

COPYRIGHT AND LICENSE
       This software is copyright (c) 2011 by Jonathan Swartz.

       This is free software; you can redistribute it and/or modify it under
       the same terms as the Perl 5 programming language system itself.

perl v5.14.2			  2012-07-04	     CHI::Driver::RawMemory(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net