eidors_cache

PURPOSE ^

EIDORS_CACHE Control eidors caching

SYNOPSIS ^

function varargout=eidors_cache( command, varargin )

DESCRIPTION ^

 EIDORS_CACHE Control eidors caching
 Usage: eidors_cache( command, limit ) for cache management
 Usage: eidors_cache(@function_handle, {params1, ... }) for shorthand
        chashing in m-files

 USAGE:
   eidors_cache( 'clear_all' ) 
   eidors_cache  clear

   eidors_cache( 'clear_old'. timestamp );
   eidors_cache( 'clear_new', timestamp );
      - clear all variables older (or newer) than timestamp
      - example:
         time_now= now;
         lots_of_eidors_calcs % don't need to cache this stuff
         eidors_cache('clear_new',time_now);

   eidors_cache( 'clear_max', memory_in_bytes );
      - clear cache so it has less than memory_in_bytes

   eidors_cache( 'cache_size', memory_in_bytes );
      - set max cache size to be memory_in_bytes
      - without 2nd arg will return current cache_size

   eidors_cache( 'clear_name', cache_name )
      - eg. eidors_cache( 'clear_name', 'inv_solve_diff_GN_one_step')
      - clear all variables with name 

   eidors_cache( 'clear_model_library' );
      - clear the eidors model library directory
      - NOTE: this function is experimental. 
      - TODO: add a way to specify what to clear
  
   eidors_cache( 'boost_priority', value)
      - modify the priority of the next cached items
      - low priority variables will be deleted first when memory is tight

   eidors_cache( 'off' )
   eidors_cache( 'disable' )
   eidors_cache( 'off', 'function_name' )
      - new values are not added to cache
      - requests for cached values return []
      - if specified, only applies to a specific function

   eidors_cache( 'on' )
   eidors_cache( 'enable' )
   eidors_cache( 'on', 'function_name' )
      - re-enables caching
      - if specified, only applies to a specific function

   eidors_cache( 'status' )
      - queries the caching status
      - 0  : all off
      - 1  : all on
      - 0.5: off for some functions

   eidors_cache( 'debug_on' )
   eidors_cache( 'debug_on', 'function_name' )
      - enables debug output
      - if specified, only applies to a specific function
      - will print a message everytime an object is removed from cache

   eidors_cache( 'debug_off' )
   eidors_cache( 'debug_off', 'function_name' );
      - disables debug output
      - if specified, only applies to a specific function

   eidors_cache( 'debug_status' )
      - queries debug status
      - output analogous to cache status above

   v1 = eidors_cache( @function_handle, {param1, param2, ...})
   [v1, v2, ...] = eidors_cache( @function_handle, {param1, param2, ...})
   [v1, v2, ...] = eidors_cache( ... , opt)
      Shorthand interface for caching the output of a specific function.
      Specify all arguments to the function as a cell array. They will all
      be used for as a caching object by default. The following options
      are available:
        opt.cache_obj
            - a single value, or a cell array of values to cache on, 
              rather than all the inputs (e.g. not all values of an input
              struct may be used in the function)
        opt.boost_priority
            - priority boost to use for that function
        opt.fstr
            - name to use for the cached result
        opt.log_level
            - message level to use with eidors_msg. By default, it's 4 for
              'setting cache' and 3 for 'using cached value'

   eidors_cache( 'cache_path' )
   eidors_cache( 'cache_path', '/path/to/cache/path' )
       - get and set cache_path, a path to a writable
           directory in which eidors can store files

   eidors_cache( 'eidors_path' )
   eidors_cache( 'eidors_path', '/path/to/eidors/' )
       - /path/to/eidors is the path in which eidors_startup.m is found

 See also EIDORS_OBJ

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function varargout=eidors_cache( command, varargin )
0002 % EIDORS_CACHE Control eidors caching
0003 % Usage: eidors_cache( command, limit ) for cache management
0004 % Usage: eidors_cache(@function_handle, {params1, ... }) for shorthand
0005 %        chashing in m-files
0006 %
0007 % USAGE:
0008 %   eidors_cache( 'clear_all' )
0009 %   eidors_cache  clear
0010 %
0011 %   eidors_cache( 'clear_old'. timestamp );
0012 %   eidors_cache( 'clear_new', timestamp );
0013 %      - clear all variables older (or newer) than timestamp
0014 %      - example:
0015 %         time_now= now;
0016 %         lots_of_eidors_calcs % don't need to cache this stuff
0017 %         eidors_cache('clear_new',time_now);
0018 %
0019 %   eidors_cache( 'clear_max', memory_in_bytes );
0020 %      - clear cache so it has less than memory_in_bytes
0021 %
0022 %   eidors_cache( 'cache_size', memory_in_bytes );
0023 %      - set max cache size to be memory_in_bytes
0024 %      - without 2nd arg will return current cache_size
0025 %
0026 %   eidors_cache( 'clear_name', cache_name )
0027 %      - eg. eidors_cache( 'clear_name', 'inv_solve_diff_GN_one_step')
0028 %      - clear all variables with name
0029 %
0030 %   eidors_cache( 'clear_model_library' );
0031 %      - clear the eidors model library directory
0032 %      - NOTE: this function is experimental.
0033 %      - TODO: add a way to specify what to clear
0034 %
0035 %   eidors_cache( 'boost_priority', value)
0036 %      - modify the priority of the next cached items
0037 %      - low priority variables will be deleted first when memory is tight
0038 %
0039 %   eidors_cache( 'off' )
0040 %   eidors_cache( 'disable' )
0041 %   eidors_cache( 'off', 'function_name' )
0042 %      - new values are not added to cache
0043 %      - requests for cached values return []
0044 %      - if specified, only applies to a specific function
0045 %
0046 %   eidors_cache( 'on' )
0047 %   eidors_cache( 'enable' )
0048 %   eidors_cache( 'on', 'function_name' )
0049 %      - re-enables caching
0050 %      - if specified, only applies to a specific function
0051 %
0052 %   eidors_cache( 'status' )
0053 %      - queries the caching status
0054 %      - 0  : all off
0055 %      - 1  : all on
0056 %      - 0.5: off for some functions
0057 %
0058 %   eidors_cache( 'debug_on' )
0059 %   eidors_cache( 'debug_on', 'function_name' )
0060 %      - enables debug output
0061 %      - if specified, only applies to a specific function
0062 %      - will print a message everytime an object is removed from cache
0063 %
0064 %   eidors_cache( 'debug_off' )
0065 %   eidors_cache( 'debug_off', 'function_name' );
0066 %      - disables debug output
0067 %      - if specified, only applies to a specific function
0068 %
0069 %   eidors_cache( 'debug_status' )
0070 %      - queries debug status
0071 %      - output analogous to cache status above
0072 %
0073 %   v1 = eidors_cache( @function_handle, {param1, param2, ...})
0074 %   [v1, v2, ...] = eidors_cache( @function_handle, {param1, param2, ...})
0075 %   [v1, v2, ...] = eidors_cache( ... , opt)
0076 %      Shorthand interface for caching the output of a specific function.
0077 %      Specify all arguments to the function as a cell array. They will all
0078 %      be used for as a caching object by default. The following options
0079 %      are available:
0080 %        opt.cache_obj
0081 %            - a single value, or a cell array of values to cache on,
0082 %              rather than all the inputs (e.g. not all values of an input
0083 %              struct may be used in the function)
0084 %        opt.boost_priority
0085 %            - priority boost to use for that function
0086 %        opt.fstr
0087 %            - name to use for the cached result
0088 %        opt.log_level
0089 %            - message level to use with eidors_msg. By default, it's 4 for
0090 %              'setting cache' and 3 for 'using cached value'
0091 %
0092 %   eidors_cache( 'cache_path' )
0093 %   eidors_cache( 'cache_path', '/path/to/cache/path' )
0094 %       - get and set cache_path, a path to a writable
0095 %           directory in which eidors can store files
0096 %
0097 %   eidors_cache( 'eidors_path' )
0098 %   eidors_cache( 'eidors_path', '/path/to/eidors/' )
0099 %       - /path/to/eidors is the path in which eidors_startup.m is found
0100 %
0101 % See also EIDORS_OBJ
0102 
0103 % (C) 2005-2013 Andy Adler and Bartlomiej Grychtol.
0104 % License: GPL version 2
0105 % $Id: eidors_cache.m 4938 2015-05-08 16:57:08Z aadler $
0106 
0107 % Comments
0108 % Want to clear specific structures
0109 %      to clear old variables
0110 %      to clear specific parts of structures
0111 
0112 if nargin==1 && isstr(command) && strcmp(command,'UNIT_TEST');
0113       do_unit_test; return; end
0114 
0115 global eidors_objects;
0116 if nargin<1
0117    fprintf('EIDORS_CACHE: current max memory = %.0f MB\n', ...
0118          eidors_objects.max_cache_size/(1024*1024)); 
0119    ww= whos('eidors_objects');
0120    fprintf('EIDORS_CACHE: cache memory used = %.0f MB\n', ...
0121          ww.bytes/(1024*1024)); 
0122    fprintf('EIDORS_CACHE: current priority = %d\n', ...
0123          eidors_objects.cache_priority); 
0124    return;
0125 elseif nargin > 1 
0126    limit = varargin{1};
0127 end
0128 
0129 if isa(command, 'function_handle')
0130       str = func2str(command);
0131       if str(1) == '@'
0132          error('Cannot cache anonymous functions');
0133       end
0134 end
0135 
0136 if isa(command, 'function_handle') || (ischar(command) && exist(command) == 2) % an m-file
0137    output = mk_varargout_str(nargout);
0138    eval(sprintf('%s = %s', output, 'cache_shorthand(command, varargin{:});'));
0139    return
0140 end
0141 
0142     
0143 switch command
0144    case 'init'
0145       eidors_objects.cache_enable = 1;
0146       eidors_objects.cache_disabled_on = [];
0147       eidors_objects.cache_debug_enable = 0;
0148       eidors_objects.cache_debug_enabled_on = [];
0149       
0150    case 'clear_all'
0151       [objid, times, sizes, prios, priidx] = get_names_times;
0152       remove_objids( objid, sizes,  1:length(sizes) );
0153 
0154    case 'clear'
0155      switch nargin
0156        case 2
0157         eidors_cache('clear_name',limit);
0158        case 1
0159         eidors_cache('clear_all');
0160        otherwise
0161          error('Wrong number of inputs');
0162      end
0163       
0164    case 'cache_size'
0165       if nargin==2
0166       if ischar(limit); limit= str2num(limit); end
0167          eidors_objects.max_cache_size = limit;
0168       else
0169          varargout{1}= eidors_objects.max_cache_size;
0170       end
0171 
0172    case 'cache_path'
0173       if nargin == 1
0174          varargout{1}= eidors_objects.cache_path;
0175       else
0176          eidors_objects.cache_path = varargin{1};
0177       end
0178 
0179    case 'eidors_path'
0180       if nargin == 1
0181          varargout{1}= eidors_objects.eidors_path;
0182       else
0183          eidors_objects.eidors_path = varargin{1};
0184       end
0185    case {'disable' 'off'}
0186        if nargin == 1
0187            eidors_objects.cache_enable = 0;
0188            eidors_objects.cache_disabled_on = {};
0189        else
0190            eidors_objects.cache_enable = 0.5;
0191            if isfield(eidors_objects,'cache_disabled_on')
0192             if ~any(strcmp(eidors_objects.cache_disabled_on, limit))
0193                 eidors_objects.cache_disabled_on = [...
0194                     eidors_objects.cache_disabled_on; {limit}];
0195             end
0196            else
0197                eidors_objects.cache_disabled_on =  {limit};
0198            end
0199        end
0200    case {'enable' 'on'}
0201        if nargin == 1
0202            eidors_objects.cache_enable = 1;
0203            eidors_objects.cache_disabled_on = {};
0204        else
0205            if isfield(eidors_objects,'cache_disabled_on')
0206                idx = strcmp(eidors_objects.cache_disabled_on, limit);
0207                eidors_objects.cache_disabled_on(idx) = [];
0208            else 
0209                eidors_objects.cache_disabled_on = [];
0210            end
0211            if isempty(eidors_objects.cache_disabled_on)
0212                eidors_objects.cache_enable = 1;
0213            end
0214        end
0215    case 'status'
0216       if nargin == 1
0217          try
0218             varargout{1} = eidors_objects.cache_enable;
0219          catch
0220             varargout{1} = 1;
0221          end
0222       else
0223          if isfield(eidors_objects,'cache_disabled_on')
0224             idx = strcmp(eidors_objects.cache_disabled_on, limit);
0225             varargout{1} = double(~any(idx));
0226          end
0227       end
0228    case 'debug_status'
0229       if nargin == 1
0230          varargout{1} = eidors_objects.cache_debug_enable;
0231       else
0232          if isfield(eidors_objects,'cache_debug_enabled_on')
0233             idx = strcmp(eidors_objects.cache_debug_enabled_on, limit);
0234             varargout{1} = double(any(idx)) | eidors_objects.cache_debug_enable==1;
0235          end
0236       end
0237    case 'debug_on'
0238        if nargin == 1
0239            eidors_objects.cache_debug_enable = 1;
0240            eidors_objects.cache_debug_enabled_on = {};
0241        else
0242            eidors_objects.cache_debug_enable = 0.5;
0243            if isfield(eidors_objects,'cache_debug_enabled_on')
0244             if ~any(strcmp(eidors_objects.cache_debug_enabled_on, limit))
0245                 eidors_objects.cache_debug_enabled_on = [...
0246                     eidors_objects.cache_debug_enabled_on; {limit}];
0247             end
0248            else
0249                eidors_objects.cache_debug_enabled_on =  {limit};
0250            end
0251        end
0252    case 'debug_off'
0253       if nargin == 1
0254          eidors_objects.cache_debug_enable = 0;
0255          eidors_objects.cache_debug_enabled_on = {};
0256       else
0257          if isfield(eidors_objects,'cache_debug_enabled_on')
0258             idx = strcmp(eidors_objects.cache_debug_enabled_on, limit);
0259             eidors_objects.cache_debug_enabled_on(idx) = [];
0260          else
0261             eidors_objects.cache_debug_enabled_on = [];
0262          end
0263          if isempty(eidors_objects.cache_debug_enabled_on)
0264             eidors_objects.cache_debug_enable = 0;
0265          end
0266       end
0267    case 'boost_priority'
0268       try
0269          varargout{1}= eidors_objects.cache_priority;
0270       catch
0271          varargout{1}= 0; % default priority
0272       end
0273       if nargin==2
0274       if ischar(limit); limit= str2num(limit); end
0275          varargout{1} = varargout{1} + limit;
0276       end
0277       eidors_objects.cache_priority = varargout{1};
0278 
0279    case {'list', 'show_objs'}
0280       [objid, times, sizes, prios, priidx, names] = get_names_times;
0281       
0282       idx = 1:length(times);
0283       if nargin == 2
0284         idx = find(arrayfun(@(c) ismember(limit, c{:}), names));
0285       end
0286       
0287       for i=idx
0288          fprintf('%s b=%9.0d p=%02d, i=%05d: %s { %s }\n', datestr(times(i),'yyyy-mm-dd HH:MM:SS.FFF'), ... %today
0289              sizes(i), prios(i), priidx(i), objid{i}, names{i}{:} );
0290       end
0291 
0292       
0293       
0294    case 'clear_max'
0295       if ischar(limit); limit= str2num(limit); end
0296 % This will remove just in order of priidx.
0297 %     remove_objids( objid, sizes,  find(cumsum(sizes) > limit) );
0298 % Remove in order of time + priority
0299       [objid, times, sizes, prios, priidx] = get_names_times;
0300       tot=     cumsum(sizes(priidx)); 
0301       remove = find(tot > limit);
0302       rmidx=   priidx(remove);
0303       remove_objids( objid, sizes,  rmidx);
0304 
0305    case 'clear_old'
0306       if ischar(limit); limit= str2num(limit); end
0307       [objid, times, sizes, prios, priidx] = get_names_times;
0308       remove_objids( objid, sizes, ...
0309          find(times < limit));
0310 
0311    case 'clear_new'
0312       if ischar(limit); limit= str2num(limit); end
0313       [objid, times, sizes, prios, priidx] = get_names_times;
0314       remove_objids( objid, sizes,  ...
0315          find(times > limit) );
0316 
0317    case 'clear_model_library'
0318       %TODO: add ways to select what to delete
0319       delete([eidors_objects.model_cache,'/*.mat']);
0320 
0321    case 'clear_name'
0322       [objid, sizes, clearidx] = clear_names_cache( limit );
0323       remove_objids( objid, sizes, clearidx);
0324       
0325    case 'dump'
0326       varargout{1} = eidors_objects;
0327       
0328    case 'load'
0329       eidors_objects = limit;
0330       
0331    otherwise
0332       error('command %s not understood',command);
0333 end
0334 
0335 
0336 function [objid, sizes, clearidx] = clear_names_cache( name );
0337    objid={}; times=[]; clearidx= [];
0338    global eidors_objects;
0339    if isempty(eidors_objects); return; end
0340    idx=1;
0341    for fn= fieldnames(eidors_objects)'
0342       fn1= fn{1};
0343       if fn1(1:3)== 'id_'
0344          objid{idx}= fn1;
0345          obj = getfield(eidors_objects, fn1 );
0346          ww= whos('obj');
0347          sizes(idx) = ww.bytes;
0348 
0349          cache= getfield(obj,'cache');
0350          if isfield(getfield(obj,'cache'), name);
0351            clearidx(end+1) = idx;
0352          end
0353 
0354          idx= idx+1;
0355       end
0356    end
0357 
0358 % priidx is priority index, where 1 prio is 0.1 of a day
0359 function [objid, times, sizes, prios, priidx, names] = get_names_times;
0360    objid={}; times=[]; sizes=[]; pri=[]; prios=[]; priidx=[];names={};
0361    global eidors_objects;
0362    if isempty(eidors_objects); return; end
0363    idx=1;
0364    for fn= fieldnames(eidors_objects)'
0365       fn1= fn{1};
0366       if fn1(1:3)== 'id_'
0367          objid{idx}= fn1;
0368 
0369          obj = getfield(eidors_objects, fn1 );
0370          try
0371             times(idx) = obj.last_used;
0372          catch
0373             times(idx) = 0; % old
0374          end
0375          try
0376             prios(idx) = obj.priority;
0377          catch
0378             prios(idx) = 0; % default
0379          end
0380          names(idx) = {fieldnames(obj.cache)};
0381          ww= whos('obj');
0382          sizes(idx) = ww.bytes;
0383 
0384          idx= idx+1;
0385       end
0386    end
0387 
0388    % sort from recent (high) to old (low)
0389    [times, idx] = sort(-times);
0390    times= -times;
0391    objid= objid(idx);
0392    sizes= sizes(idx);
0393    prios= prios(idx);
0394    names= names(idx);
0395    % sort from high to low priority and recent (high) to old (low)
0396    [jnk, priidx] = sortrows([-prios(:), -times(:)]);
0397 
0398 function remove_objids( objid, sizes, idx)
0399    global eidors_objects;
0400    
0401    switch eidors_cache('debug_status')
0402       case 1
0403          for i = 1:length(idx)
0404             debug_msg(objid{idx(i)},'removed');
0405          end
0406       case 0.5
0407          for i = 1:length(idx)
0408             flds = fieldnames(eidors_objects.(objid{idx(i)}).cache);
0409             for j = 1:numel(flds)
0410                if eidors_cache('debug_status',flds)
0411                   debug_msg(objid{idx(i)}, 'removed');
0412                   break
0413                end
0414             end
0415          end
0416    end
0417    
0418    eidors_objects= rmfield( eidors_objects, objid( idx ) );
0419    eidors_msg('Removed %d objects with %d bytes from cache', ...
0420           length(idx), sum(sizes(idx)), 2 );
0421 
0422        
0423 function varargout = cache_shorthand(fhandle, varargin)
0424 % Will cache on all function inputs, unless opt.cache_obj is specified
0425    args = varargin{1};
0426    if ~iscell(args)
0427       args = {args};
0428    end
0429    
0430    if nargin >2
0431       opt = varargin{2};
0432    else
0433       opt = struct;
0434    end
0435    if ischar(opt)
0436       fstr = opt; clear opt;
0437       opt.fstr = fstr;
0438    end
0439    if isfield(opt, 'cache_obj');
0440       cache_obj = opt.cache_obj;
0441       if ~iscell(cache_obj)
0442          cache_obj = {cache_obj};
0443       end
0444    else
0445       cache_obj = args;
0446    end
0447    try
0448       fstr = opt.fstr;
0449    catch
0450       fstr = func2str(fhandle);
0451    end
0452    if isfield(opt, 'log_level')
0453        level_in = opt.log_level;
0454        level_out = opt.log_level;
0455    else
0456        level_in = 4;
0457        level_out = 3;
0458    end
0459    
0460    varargout = eidors_obj('get-cache', cache_obj, fstr );
0461    if numel(varargout) < nargout
0462       eidors_msg('@@ (Re)calculating %s',fstr, level_in);
0463       output = mk_varargout_str(nargout);
0464       varargout = cell(0);
0465       eval(sprintf('%s = %s', output, 'feval(fhandle,args{:});'));
0466       
0467       if isfield(opt,'boost_priority');
0468          eidors_cache('boost_priority',opt.boost_priority);
0469       end
0470       
0471       eidors_obj('set-cache', cache_obj, fstr, varargout);
0472       
0473       if isfield(opt,'boost_priority');
0474          eidors_cache('boost_priority',-opt.boost_priority);
0475       end
0476       return
0477    end
0478    eidors_msg('%s: Using cached value',fstr,level_out);
0479 
0480 function output = mk_varargout_str(N)
0481 output = '[';
0482 for i = 1:N
0483    output = [ output sprintf('varargout{%d} ',i)];
0484 end
0485 output = [ output ']' ];
0486 
0487 function debug_msg(id,action)
0488 global eidors_objects;
0489 name = fieldnames(eidors_objects.(id).cache);
0490 fprintf('EIDORS_CACHE: %s %s {', action, id);
0491 fprintf(' %s', name{:});
0492 fprintf(' }\n');
0493 % dbstack could be useful too
0494 
0495 function do_unit_test
0496 
0497    ll= eidors_msg('log_level');
0498    eidors_msg('log_level',5);
0499    eidors_cache
0500    eidors_cache('clear_all');
0501    eidors_cache
0502    eidors_obj('set-cache', rand(1) , 't1', rand(2e3));
0503    eidors_obj('set-cache', rand(1) , 't2', rand(2e3));
0504    eidors_obj('set-cache', rand(1) , 't3', rand(2e3));
0505    eidors_cache('clear_name','t3');
0506    eidors_cache
0507    eidors_cache('clear_max', 34e6);
0508    eidors_cache
0509    eidors_cache('boost_priority', 1);
0510    eidors_cache
0511    eidors_cache('boost_priority', -1);
0512    eidors_cache
0513    [v1] = eidors_cache(@test_function,{3,4});
0514    [v2] = eidors_cache(@test_function,{3,4});
0515    unit_test_cmp('shorthand 1 param:',v1,v2);
0516    [v3 v4] = eidors_cache(@test_function,{3,4});
0517    unit_test_cmp('Expect Fail', v3, v4,-inf);
0518    [v5 v6 ] = eidors_cache(@test_function,{3,4});
0519    unit_test_cmp('shorthand 2 params:',v4, v6);
0520    [v5 v6 ] = eidors_cache(@test_function,{3,4, 5}); %this should re-calc
0521    opt.cache_obj = 5;
0522    [v5 v6 ] = eidors_cache(@test_function,{3,4, 5}, opt); %this should re-calc
0523    [v7 v8 ] = eidors_cache(@test_function,{1,2, 3}, opt); %this should NOT
0524    unit_test_cmp('shorthand cache_obj:',v6, v8);
0525    eidors_cache clear_all
0526    opt = struct;
0527    [v7 v8 ] = eidors_cache(@test_function,{1,2, 3}, opt); %this should NOT
0528    opt.boost_priority = 2;
0529    [v7 v8 ] = eidors_cache(@test_function,{3,4, 5}, opt); %this should NOT
0530    eidors_cache show_objs
0531    eidors_cache
0532    eidors_msg('log_level',ll);
0533    try
0534       eidors_cache(@(x) x^2, 3);
0535    catch
0536       eidors_msg('Error on anonymous function: correct',2);
0537    end
0538    test_debug
0539    
0540 function [v1 v2] = test_function(a,b,c,d)
0541    v1 = rand(1);
0542    v2 = rand(1);
0543    
0544 function test_debug
0545    eidors_cache clear
0546    eidors_obj('set-cache',{5}, 'test1',50);
0547    eidors_obj('set-cache',{5}, 'test2',500);
0548    eidors_obj('set-cache',{10}, 'test1',100);
0549    eidors_cache show_objs
0550    eidors_cache debug_off
0551    eidors_cache debug_on test2
0552    eidors_cache clear_name test2
0553    eidors_cache show_objs
0554 %    eidors_obj('set-cache',{5}, 'test1',50);
0555    eidors_obj('set-cache',{5}, 'test2',500);
0556    eidors_cache debug_off
0557    eidors_cache debug_on test1
0558    eidors_cache clear_name test2
0559    eidors_cache('clear_max',0)
0560    eidors_cache('show_objs')
0561    eidors_cache debug_off
0562    
0563    
0564    
0565 %    obj= eidors_obj('get-cache',{5}, 'test1');

Generated on Tue 12-May-2015 16:00:42 by m2html © 2005