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
Data::ObjectDriver::Driver::BaseCache(3) User Contributed Perl Documentation Data::ObjectDriver::Driver::BaseCache(3)

Data::ObjectDriver::Driver::BaseCache - parent class for caching object drivers

Data::ObjectDriver::Driver::BaseCache provides behavior utilized for all caching object drivers for use with Data::ObjectDriver. That behavior is looking up requested objects in a cache, and falling back to another Data::ObjectDriver for a cache miss.

Drivers based on Data::ObjectDriver::Driver::BaseCache support all standard operations for Data::ObjectDriver object drivers (lookup, search, update, insert, replace, remove, and fetch_data). BaseCache-derived drivers also support:

Creates a new instance of a BaseCache driver. Required members of %params are:
  • "cache"

    The object with which to interface with the external cache. For example, for the "Memcached" caching object driver, the value of the "cache" member should be a "Cache::Memcached" object.

  • "fallback"

    The "Data::ObjectDriver" object driver to which to fall back when the cache does not yet contain a requested object. The "fallback" member is also the object driver to which updates and inserts are passed.

Returns the cache key for an object of the given class with the given primary key. The cache key is used with the external cache to identify an object.

In BaseCache's implementation, the key is the class name and all the column names of the primary key concatenated, separated by single colons.

Returns the objects corresponding to the given cache keys, as represented in the external cache.

Returns whether caches of the given class are disabled, first updating the disabled state of drivers of the given class to $value, if given. When a caching driver is disabled, all operations are automatically passed through to the fallback object driver.

Note that, if you disable and reenable a caching driver, some of the cached data may be invalid due to updates that were performed while the driver was disabled not being reflected in the external cache.

When creating a caching driver from "BaseCache", the behavior for interaction with the external cache (through the "cache" member of the constructor) must be defined by implementing these methods:

Sets the cache entry for $cache_key to the given object representation. This method is used when the corresponding object is being saved to the database for the first time.

Sets the cache entry for $cache_key to the given object representation. This method is used when the corresponding object already exists in the database and is being saved.

Clears the given cache entry. This method is used when the corresponding object is being deleted from the database.

Returns the object corresponding to the given cache key, as it exists in the external cache.

Returns an instance of $class containing the data in the representation $obj_repr, as returned from the "get_from_cache" method.

In BaseCache's implementation, no operation is performed. "get_from_cache" should itself return the appropriate instances of "Data::ObjectDriver::BaseObject".

Returns a representation of the given "Data::ObjectDriver::BaseObject" instance, suitable for passing to the "add_to_cache" and "update_cache" methods.

In BaseCache's implementation, no operation is performed. "add_to_cache" and "update_cache" should themselves accept "Data::ObjectDriver::BaseObject" instances.

Data::ObjectDriver is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

Except where otherwise noted, Data::ObjectDriver is Copyright 2005-2006 Six Apart, cpan@sixapart.com. All rights reserved.
2020-10-29 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.