App::ResourceLocker - Interface for locking shared resources
use App; $context = App->context(); $srs = $context->service("ResourceLocker"); # or ... $srs = $context->shared_resource_set();
A ResourceLocker service represents a collection of "advisory" (or "cooperative") resource locks.
The following classes might be a part of the ResourceLocker Class Group.
Class: App::ResourceLocker
Class: App::ResourceLocker::IPCLocker
Class: App::ResourceLocker::IPCSemaphore
Class: App::ResourceLocker::BerkeleyDB
A ResourceLocker service represents a collection of "advisory" (or "cooperative") resource locks. These can be used to synchronize access to and modification of shared resources such as are stored in a SharedDatastore.
* Throws: App::Exception::ResourceLocker * Since: 0.01
The constructor is inherited from App::Service.
App::Service
* Signature: $resource_name = $srs->lock($resource_pool); * Signature: $resource_name = $srs->lock($named); * Param: $resource_pool string * Param: resourcePool string * Param: nonBlocking boolean * Param: nonExclusive boolean * Param: maxWaitTimeMS integer * Return: $resource_name string * Throws: App::Exception::ResourceLocker * Since: 0.01 Sample Usage: $context = App->context(); $srs = $context->service("ResourceLocker"); $srs->lock("shmem01");
The lock() method on a ResourceLocker is for the purposes of cooperative resource locking.
* Signature: $srs->unlock($resource_name); * Param: $resource_name string * Return: void * Throws: App::Exception::ResourceLocker * Since: 0.01 Sample Usage: $context = App->context(); $srs = $context->service("ResourceLocker"); $srs->unlock("shmem01");
Returns 'ResourceLocker';
* Signature: $service_type = App::ResourceLocker->service_type(); * Param: void * Return: $service_type string * Since: 0.01 $service_type = $rlock->service_type();
* Author: Stephen Adkins <spadkins@gmail.com> * License: This is free software. It is licensed under the same terms as Perl itself.
App::Context, App::Service
App::Context
To install App::Context, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Context
CPAN shell
perl -MCPAN -e shell install App::Context
For more information on module installation, please visit the detailed CPAN module installation guide.