#include "nsd.h"Data Structures | |
| struct | TclCache |
| struct | Val |
Functions | |
| void | NsTclInitCacheType (void) |
| int | NsTclCacheObjCmd (ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj **objv) |
| int NsTclCacheObjCmd | ( | ClientData | arg, | |
| Tcl_Interp * | interp, | |||
| int | objc, | |||
| Tcl_Obj ** | objv | |||
| ) |
----------------------------------------------------------------------
NsTclCacheObjCmd --
Handle the ns_cache command. See the documentation for details. Note that mixing the "eval" option with other options (e.g., "get", "set", "incr", etc.) doesn't make sense. In particular, there's no generally correct way to handle a "get" or "set" encountering an in-progress "eval", i.e., a NULL value. In these case the code below returns an immediate error.
Results: Standard Tcl result.
Side effects: May cause the current thread to wait for another thread to update a given entry with the eval option.
----------------------------------------------------------------------
Handle create directly as all other commands require a valid cache argument.
NB: Silence compiler warning.
Return keys for all cache entries, flushing any expired items first.
Flush one or more entries from the cache.
Get the current value if not expired and not currently being refreshed.
Set a value, ignoring current state (if any) of the entry.
Increment a value, assuming the previous value is a valid integer. No value or expired value is treated as starting at zero.
Append or list append one or more elements to current value.
Get a value from cache, setting or refreshing the value with given script when necessary. A NULL value is maintained in the cache during the update script to avoid multiple threads updating the same value at once.
Wait for another thread to complete an update.
Return current value.
Refresh the entry.
| void NsTclInitCacheType | ( | void | ) |
----------------------------------------------------------------------
NsTclInitCacheType --
Initialize the type for Tcl caches.
Results: None.
Side effects: None.
----------------------------------------------------------------------
1.5.1