%3 ::nx::Object ::nx::Object __default_accessor __default_method_call_protection __object_configureparameter __resolve_method_path contains copy delete object method delete object property delete object variable destroy_on_cleanup info info info lookup parameters info lookup slots info lookup syntax info lookup variables info object method args info object method body info object method callprotection info object method debug info object method definition info object method definitionhandle info object method deprecated info object method exists info object method handle info object method origin info object method parameters info object method registrationhandle info object method returns info object method submethods info object method syntax info object method type info object slots info object variables info variable definition info variable name info variable parameter move object alias object forward object method object property object variable private protected public qn require namespace require object method require private object method require protected object method require public object method serialize ::acs::Cache ::acs::Cache cache_create cache_name eval flush flush_all flush_cache flush_pattern get get_size init set show_all ::acs::Cache->::nx::Object ::acs::PartitionedCache ::acs::PartitionedCache cache_name flush_all flush_pattern_in_all_partitions init show_all ::acs::PartitionedCache->::acs::Cache ::acs::KeyPartitionedCache ::acs::KeyPartitionedCache flush_pattern set ::acs::KeyPartitionedCache->::acs::PartitionedCache

Class ::acs::Cache

::acs::Cache[i] create ... \
           [ -default_size (default "100KB") ] \
           [ -maxentry:integer maxentry:integer ] \
           [ -name name ] \
           [ -package_key:required package_key:required ] \
           [ -parameter:required parameter:required ] \
           [ -timeout (default "5m") ]

Base class for cache management
Defined in packages/acs-tcl/tcl/acs-cache-procs.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nx::Object[i]
  • subclass: ::acs::PartitionedCache[i]

Methods (to be applied on instances)

  • eval (scripted, public)

     <instance of acs::Cache[i]> eval [ -partition_key partition_key ] \
        [ -expires expires ] [ -timeout timeout ] [ -per_request ] key \
        command

    Evaluate the command unless the result was already computed before and cached.

    Switches:
    -partition_key (optional)
    Used for determining the cache name in partitioned caches. The partition key is computed typically automatically depending on the cache type.
    -expires (optional)
    Lifetime of the cache entry. The entry will be purged automatically when the time is reached. The time is in seconds unless a time unit is specified (e.g., 5m)
    -timeout (optional)
    Maximum time to wait for the command to complete. The time is in seconds unless a time unit is specified (e.g., 2.5m)
    -per_request (optional)
    When set, cache the result per request. So far, no attempt is made to flush the result during the lifetime of the request.
    Parameters:
    key (required)
    The cache key
    command (required)
    The command to be executed when the result is not yet cached.

    Testcases:
    No testcase defined.
  • flush (scripted, public)

     <instance of acs::Cache[i]> flush [ -partition_key partition_key ] \
        key

    Flush a single entry in the cache

    Switches:
    -partition_key (optional)
    Parameters:
    key (required)

    Testcases:
    No testcase defined.
  • flush_all (scripted, public)

     <instance of acs::Cache[i]> flush_all

    Flush all contents of all (partitioned) caches. In the case of a base ::acs::Cache, it is identical to "flush_cash".

    Testcases:
    No testcase defined.
  • flush_cache (scripted, public)

     <instance of acs::Cache[i]> flush_cache \
        [ -partition_key partition_key ]

    Flush all entries in a cache.

    Switches:
    -partition_key (optional)

    Testcases:
    No testcase defined.
  • flush_pattern (scripted, public)

     <instance of acs::Cache[i]> flush_pattern \
        [ -partition_key partition_key ] pattern

    Flush in the cache a value based on a pattern operation. Use this function rarely, since on large caches (e.g. 100k entries or more) the glob operation will cause long locks, which should be avoided. The partitioned variants can help to reduce the lock times.

    Switches:
    -partition_key (optional)
    Parameters:
    pattern (required)

    Testcases:
    No testcase defined.
  • get (scripted, public)

     <instance of acs::Cache[i]> get [ -partition_key partition_key ] \
        key

    The "get" method retrieves data from the cache. It should not be used for new applications due to likely race conditions, but legacy applications use this. As implementation, we use the AOLserver API emulation.

    Switches:
    -partition_key (optional)
    Parameters:
    key (required)

    Testcases:
    No testcase defined.
  • init (scripted, public)

     <instance of acs::Cache[i]> init

    If the name was not provided, use the object name as default.

    Testcases:
    No testcase defined.
  • set (scripted, public)

     <instance of acs::Cache[i]> set [ -partition_key partition_key ] \
        key value

    Set a single value in the cache. This code uses ns_cache_eval to achieve this behavior, which is typically an AOLserver idiom and should be avoided.

    Switches:
    -partition_key (optional)
    Parameters:
    key (required)
    value (required)

    Testcases:
    No testcase defined.
  • show_all (scripted, public)

     <instance of acs::Cache[i]> show_all

    Log all cache keys to the system log. The primary usage is for debugging.

    Testcases:
    No testcase defined.