Apache::SharedMem

Apache::SharedMem allows you to share data between Apache children processes through the shared memory.
Download

Apache::SharedMem Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Olivier Poitrey
  • Publisher web site:
  • http://search.cpan.org/~rsoliv/Apache-SharedMem-0.09/lib/Apache/SharedMem.pm

Apache::SharedMem Tags


Apache::SharedMem Description

Apache::SharedMem allows you to share data between Apache children processes through the shared memory. Apache::SharedMem allows you to share data between Apache children processes through the shared memory.SYNOPSIS use Apache::SharedMem qw(:lock :status); my $share = new Apache::SharedMem || die($Apache::SharedMem::ERROR); $share->set(key => 'some data'); # ...maybe in another apache child my $var = $share->get(key); $share->delete(key); # delete all keys if the total size is larger than $max_size $share->clear if($share->size > $max_size); # using an exclusive blocking lock, but with a timeout my $lock_timeout = 40; # seconds if($share->lock(LOCK_EX, $lock_timeout)) { my $data =... ...some traitement... $share->set(key => $data); # the implicite lock is not overrided warn('failed to store data in shared memory') if($share->status & FAILURE); $share->unlock; } $share->release;This module make it easier to share data between Apache children processes through shared memory. This module internal functionment is much inspired from IPC::SharedCache, but without any cache management. The share memory segment key is automatically deduced by the caller package, which means that 2 modules can use same keys without being concerned about namespace clash. An additionnal namespace is used per application, which means that the same module, with the same namespace used in two applications doesn't clash too. Application distinction is made on two things : the process' UID and DOCUMENT_ROOT (for http applications) or current working directory. Requirements: · Perl


Apache::SharedMem Related Software