%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") ]

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nx::Object[i]
  • subclass: ::acs::PartitionedCache[i]
::nx::Class create ::acs::Cache \
     -superclass ::nx::Object

Methods (to be applied on instances)

  • eval (scripted)

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

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_xotcl-core xotcl-core (test ) acs::Cache instproc eval acs::Cache instproc eval test_xotcl-core->acs::Cache instproc eval test_xotcl_core_tutorial_2 xotcl_core_tutorial_2 (test ) test_xotcl_core_tutorial_2->acs::Cache instproc eval test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->acs::Cache instproc eval

    Testcases:
    xotcl_core_tutorial_2, xotcl-core, xowiki_test_cases
    if {![info exists partition_key]} {
        set partition_key $key
    }
    foreach optional_parameter {expires timeout} {
        if {[info exists $optional_parameter]} {
            set ${optional_parameter}_flag [list -$optional_parameter [set $optional_parameter]]
        } else {
            set ${optional_parameter}_flag ""
        }
    }
    set cache_name [:cache_name $partition_key]
    try {
        if {$per_request} {
            acs::per_request_cache eval -key ::acs-${cache_name}($key) {
                :uplevel [list ns_cache_eval  {*}$expires_flag {*}$timeout_flag --  $cache_name $key $command]
            }
        } else {
            :uplevel [list ns_cache_eval {*}$expires_flag {*}$timeout_flag --  $cache_name $key $command]
        }
    
    } on break {r} {
        #
        # When the command ends with "break", it means:
        # "don't cache". We return in this case always a
        # 0.
        #
        #ns_log notice "====================== [self] $key -> break -> <$r>"
        return 0
    
    } on ok {r} {
        return $r
    }
  • flush (scripted)

    if {![info exists partition_key]} {
        set partition_key $key
    }
    ::acs::clusterwide ns_cache flush [:cache_name $partition_key$key
  • flush_all (scripted)

    :flush_cache
  • flush_cache (scripted)

    ::acs::clusterwide ns_cache_flush [:cache_name $partition_key]
    #ns_log notice "flush_all -> ns_cache_flush [:cache_name $partition_key]"
    #ns_log notice "... content of ${:name}: [ns_cache_keys ${:name}]"
  • flush_pattern (scripted)

    return [::acs::clusterwide ns_cache_flush -glob [:cache_name $partition_key$pattern]
  • get (scripted)

    if {![info exists partition_key]} {
        set partition_key $key
    }
    return [ns_cache get [:cache_name $partition_key$key]
  • init (scripted)

    if {![info exists :name]} {
        set :name [namespace tail [current]]
    }
    :cache_create ${:name} [:get_size]
  • set (scripted)

    if {![info exists partition_key]} {
        set partition_key $key
    }
    :uplevel [list ns_cache_eval -force -- [:cache_name $partition_key$key [list set _ $value]]
  • show_all (scripted)

    ns_log notice "content of ${:name}: [ns_cache_keys ${:name}]"