The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Alzabo::ObjectCache::Sync::Null - No inter-process cache syncing

SYNOPSIS

  use Alzabo::ObjectCache( store => 'Alzabo::ObjectCache::Store::Memory',
                           sync  => 'Alzabo::ObjectCache::Sync::Null' );

DESCRIPTION

This class does not do any actual inter-process syncing. It does, however, keep track of deleted objects. This is needed in the case where one part of a program deletes an object to which another part of the program has a refence. If the other part attempts to use the object an exception will be thrown.

If you are running Alzabo as part of a single-process application, using this syncing module along with one of the caching modules will increase the speed of your application. Using it in a multi-process situation is likely to cause data corruption unless your application is entirely read-only.

"CACHING SCENARIOS" in Alzabo::ObjectCache.

METHODS

new

Returns

A new Alzabo::ObjectCache object.

fetch_object ($id)

Returns

The specified object if it is in the cache. Otherwise it returns undef.

store_object ($object)

Stores an object in the cache. This will not overwrite an existing object in the cache. To do that you must first call the delete_from_cache method.

is_expired ($object)

Objects cached in this class are never expired.

Returns

This always false for this class because there is no notion of expiration for this cache.

is_deleted ($object)

Returns

A boolean value indicating whether or not an object has been deleted from the cache.

register_refresh ($object)

This does nothing in this class.

register_change ($object)

This does nothing in this class.

register_delete ($object)

This tells the cache that the object has been removed from its external data source. This causes the cache to remove the object internally. Future calls to is_deleted for this object will now return true.

delete_from_cache ($object)

This method allows you to remove an object from the cache. This does not register the object as deleted. It is provided solely so that you can call store_object after calling this method and have store_object actually store the new object.

CLASS METHOD

clear

Call this method to completely clear the cache.

CAVEATS

This module has no upper limit on how many objects it will store. If you are operating in a persistent environment such as mod_perl, these will have a tendency to eat up memory over time.

In order to prevent processes from growing without stop, it is recommended that you call the clear method at the entry point(s) for your persistent application. This will flush the cache completely. You can also call this method whenever you know you are done using any row objects you've created up to a certain point in your application. However, if you plan on creating them again later it would probably be a performance win to not do this.

AUTHOR

Dave Rolsky, <autarch@urth.org>