Apache-Session-Memorycached

 view release on metacpan or  search on metacpan

lib/Apache/Session/Store/Memorycached.pm  view on Meta::CPAN

           }
 
   $self->{opened} = 0;
    
    }

sub close {
    my $self = shift;

    if ($self->{opened}) {
        $self->{opened} = 0;
    }
}

sub DESTROY {
    my $self = shift;

    if ($self->{opened}) {    
    }
}

1;

=pod

=head1 NAME

Apache::Session::Store::Memorycached - Store persistent data on the network with  memcached

=head1 SYNOPSIS


 use Apache::Session::Store::Memorycached;
 
 my $store = new Apache::Session::Store::Memorycached;
 
 $store->insert($ref);
 $store->update($ref);
 $store->materialize($ref);
 $store->remove($ref);

=head1 DESCRIPTION

This module fulfills the storage interface of Apache::Session.  The serialized
objects are stored in files on your network in unused memory 

=head1 OPTIONS

This module requires one argument in the usual Apache::Session style.  The
name of the option is servers, and the value is the  same of memcached .
 Example

 tie %s, 'Apache::Session::Memorycached', undef,
    {servers  => ['mymemcachedserver:port'],
     'timeout' => '300',
     'updateOnly' => 1 ,
     'principal' => uid,  
        };

In order to optimize the network ,you can use a local memcached server.
All read-only opération are sending fisrt at local server .If you need write ou rewrite data , the data is sending at the principal memcached sever and local cache too  for synchronisation.

note :  'updateOnly' => 1  just realize up-date operation not init operation. 
 Init operation is use in order to book and lock the number session but it's not available in this module 
 
  'principal' => uid :  this  parameter is use to create reverse reference 
  like this : MD5_hex(uid) => id_session in memcached server . By this it usefull to retrieve id_session from principal name . And add uid_MD5 => MD5_hex(uid) in main session .
 

=head1 NOTES


=head1 AUTHOR

This module was written by eric german <germanlinux@yahoo.fr> 

=head1 SEE ALSO

L<Apache::Session>



( run in 1.191 second using v1.01-cache-2.11-cpan-140bd7fdf52 )