Object ::ns_cache (public)
::nx::Object ::ns_cache
Defined in packages/xotcl-core/tcl/01-debug-procs.tcl
- Testcases:
- No testcase defined.
Source code: ::nsf::object::alloc ::nx::Object ::ns_cache {} ::ns_cache public object method create {cache_name {-size 1024000} -timeout} { # expire in NS means timeout in AOLserver if {[info exists timeout]} { set create_cmd "ns_cache_create -expires $timeout $cache_name $size" } else { set create_cmd "ns_cache_create $cache_name $size" } return [{*}$create_cmd] } ::ns_cache public object method eval {cache_name key script} { set rc [catch {uplevel [list ns_cache_eval $cache_name $key $script]} result] return -code $rc $result } ::ns_cache public object alias flush ::ns_cache_flush ::ns_cache public object method get {cache_name key var_name:optional} { if {[info exists var_name]} { return [uplevel [list ns_cache_get $cache_name $key $var_name]] } else { return [ns_cache_get $cache_name $key] } } ::ns_cache public object method names {cache_name args} { set ts0 [clock clicks -milliseconds] set r [ns_cache_keys $cache_name {*}$args] set span [expr {[clock clicks -milliseconds] - $ts0}] if {$span > 100} { ad_log notice "!!!! long ns_cache_names $span ms, ns_cache names $cache_name $args" } return $r } ::ns_cache public object method set {cache_name key value} { uplevel ns_cache_eval -force -- $cache_name [list $key] [list set _ $value] } ::ns_cache protected object method unknown {subcmd cache_name args} { ns_log notice "ns_cache unknown, subcmd=$subcmd, args=$args" set ts0 [clock clicks -milliseconds] #ns_log notice "ns_cache $subcmd $cache_name" set rc [catch {uplevel ns_cache_$subcmd $cache_name $args} result] set span [expr {[clock clicks -milliseconds] - $ts0}] if {$span > 100} { ad_log notice "!!!! long ns_cache $subcmd $span ms, ns_cache $subcmd $cache_name $args" } #if {$rc != 0} {ns_log notice "EVAL returned code=$rc result='$result'"} return -code $rc $result }XQL Not present: Generic, PostgreSQL, Oracle