Show
Ignore:
Timestamp:
10/31/08 16:16:22 (5 years ago)
Author:
bonnu
Message:

lang/perl/Method-Cached - POD was written only a little

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Method-Cached/trunk/lib/Method/Cached.pm

    r22060 r22433  
    136136  use Method::Cached; 
    137137    
    138   sub message :Cached(5) { 
    139       join ':', @_, time, rand 
    140   } 
     138  sub message :Cached(5) { join ':', @_, time, rand } 
    141139   
    142140  package main; 
     
    152150 
    153151Method::Cached offers the following mechanisms: 
     152 
    154153The return value of the method is stored in storage, and 
    155 the value stored when being execute it next time is returned.  
     154the value stored when being execute it next time is returned. 
     155 
     156=head2 SETTING OF CACHED DOMAIN 
     157 
     158In beginning logic or the start-up script: 
     159 
     160  use Method::Cached; 
     161   
     162  Method::Cached->default_domain({ 
     163      storage_class => 'Cache::FastMmap', 
     164  }); 
     165   
     166  Method::Cached->set_domain( 
     167      'some-namespace' => { 
     168          storage_class => 'Cache::Memcached::Fast', 
     169          storage_args  => [ 
     170              { 
     171                  # Parameter of constructor of class that uses it for cashe 
     172                  servers => [ '192.168.254.2:11211', '192.168.254.3:11211' ], 
     173                  ... 
     174              }, 
     175          ], 
     176      }, 
     177  ); 
     178 
     179=head2 DEFINITION OF METHODS 
     180 
     181This function is mounting used as an attribute of the method.  
     182 
     183=over 4 
     184 
     185=item B<:Cached ( DOMAIN_NAME, EXPIRES, [, KEY_RULE, ...] )> 
     186 
     187The cached rule is defined specifying the domain name. 
     188 
     189  sub message :Cached('some-namespace', 60 * 5, LIST) { ... } 
     190 
     191=item B<:Cached ( EXPIRES, [, KEY_RULE, ...] )> 
     192 
     193When the domain name is omitted, the domain of default is used. 
     194 
     195  sub message :Cached(60 * 30, LIST) { ... } 
     196 
     197=back 
     198 
     199=head2 RULE TO GENERATE KEY 
     200 
     201=over 4 
     202 
     203=item B<LIST> 
     204 
     205=item B<SERIALIZE> 
     206 
     207=item B<SELF_SHIFT> 
     208 
     209=item B<SELF_CODED> 
     210 
     211=item B<PER_OBJECT> 
     212 
     213=back 
     214 
     215=head1 METHODS 
     216 
     217=over 4 
     218 
     219=item B<default_domain ($setting)> 
     220 
     221=item B<set_domain (%domain_settings)> 
     222 
     223=item B<get_domain ($domain_name)> 
     224 
     225=back 
    156226 
    157227=head1 AUTHOR