- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::acs::LockfreeCache
::acs::LockfreeCache create ... \Lockfree caches are provided either as per-thread caches or per-request caches, sharing the property that accessing these values does not require locks. Typical applications of these caches are the per_request_cache and per_thread_cache. Defined in packages/acs-tcl/tcl/acs-cache-procs.tcl
[ -prefix prefix ]
Class Relations
Methods (to be applied on instances)
eval (scripted, public)
<instance of acs::LockfreeCache> eval -key key \ [ -no_cache no_cache ] [ -no_empty ] \ [ -from_cache_indicator from_cache_indicator ] cmdUse the "prefix" to determine whether the cache is per-thread or per-request.
- Switches:
- -key (required)
- key for caching, should start with package-key and a dot to avoid name clashes
- -no_cache (optional)
- list of returned values that should not be cached
- -no_empty (optional, defaults to
"false"
)- don't cache empty values. This flag is deprecated, one should use the no_cache flag instead.
- -from_cache_indicator (optional)
- variable name to indicate whether the returned value was from cache or not
- Parameters:
- cmd (required)
- command to be executed.
- Returns:
- return the last value set (don't use "return").
- Testcases:
- No testcase defined.
flush (scripted, public)
<instance of acs::LockfreeCache> flush [ -pattern pattern ]Flush a cache entry based on the pattern (which might be wild-card-free). Currently, the clusterwide flushing is omitted. We have the per-request cache (clusterwide operations do not make sense for this) and per-thread caching. The per-thread caching application have to be aware that flushing is happening only in one thread, so clusterwide operations will only start to make sense, when the all threads of a server would be cleaned.
- Switches:
- -pattern (optional, defaults to
"*"
)- Testcases:
- No testcase defined.
get (scripted, public)
<instance of acs::LockfreeCache> get -key key varGet entry with the provided key from this cache if it exists. In most cases, the "eval" method should be used.
- Switches:
- -key (required)
- cache key
- Parameters:
- var (required)
- Returns:
- return boolean value indicating success.
- Testcases:
- No testcase defined.
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables