Page Speed Optimization Libraries  1.3.25.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Friends
net_instaweb::DelayCache Class Reference

See file comment. More...

#include "delay_cache.h"

Inheritance diagram for net_instaweb::DelayCache:
net_instaweb::CacheInterface

List of all members.

Public Member Functions

 DelayCache (CacheInterface *cache, ThreadSystem *thread_system)
 Note: takes ownership of nothing.
virtual void Get (const GoogleString &key, Callback *callback)
 Reimplementations of CacheInterface methods.
virtual void Put (const GoogleString &key, SharedString *value)
virtual void Delete (const GoogleString &key)
virtual void MultiGet (MultiGetRequest *request)
void DelayKey (const GoogleString &key)
void ReleaseKey (const GoogleString &key)
void ReleaseKeyInSequence (const GoogleString &key, QueuedWorkerPool::Sequence *sequence)
virtual const char * Name () const
 The name of this CacheInterface -- used for logging and debugging.
virtual bool IsBlocking () const
virtual bool IsHealthy () const
virtual void ShutDown ()

Friends

class DelayCallback

Detailed Description

See file comment.


Member Function Documentation

Instructs the cache to delay delivery of callbacks for specific cache-key. It is a fatal error -- reported at class destruction, to request delay of a key that is never looked up and released.

virtual bool net_instaweb::DelayCache::IsBlocking ( ) const [inline, virtual]

Returns true if this cache is guaranteed to call its callbacks before returning from Get and MultiGet.

Implements net_instaweb::CacheInterface.

virtual bool net_instaweb::DelayCache::IsHealthy ( ) const [inline, virtual]

Returns true if the cache is in a healthy state. Memory and file-based caches can simply return 'true'. But for server-based caches, it is handy to be able to query to see whether it is in a good state. It should be safe to call this frequently -- the implementation shouldn't do much more than check a bool flag under mutex.

Implements net_instaweb::CacheInterface.

virtual void net_instaweb::DelayCache::MultiGet ( MultiGetRequest *  request) [virtual]

Gets multiple keys, calling multiple callbacks. Default implementation simply loops over all the keys and calls Get.

MultiGetRequest, declared above, is a vector of structs of keys and callbacks.

Ownership of the request is transferred to this function.

Reimplemented from net_instaweb::CacheInterface.

virtual void net_instaweb::DelayCache::Put ( const GoogleString key,
SharedString value 
) [virtual]

Puts a value into the cache. The value that is passed in is not modified, but the SharedString is passed by non-const pointer because its reference count is bumped.

Implements net_instaweb::CacheInterface.

void net_instaweb::DelayCache::ReleaseKey ( const GoogleString key) [inline]

Release the delay on the callback delivered for a specific key. It is ane error to attempt to release a key that was never delayed.

See ReleaseKey. If sequence is non-NULL, the callback is delivered on the sequence, otherwise it is delivered directly from ReleaseKey.

virtual void net_instaweb::DelayCache::ShutDown ( ) [inline, virtual]

Stops all cache activity. Further Put/Delete calls will be dropped, and MultiGet/Get will call the callback with kNotFound immediately. Note there is no Enable(); once the cache is stopped it is stopped forever. This function is intended for use during process shutdown.

Implements net_instaweb::CacheInterface.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines