DBIx::Locker::Lock - a live resource lock
version 1.103
This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years.
Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl.
Calling this method is a very, very stupid idea. This method is called by DBIx::Locker to create locks. Since you are not a locker, you should not call this method. Seriously.
my $locker = DBIx::Locker::Lock->new(\%arg);
This returns a new lock.
locker - the locker creating the lock lock_id - the id of the lock in the lock table expires - the time (in epoch seconds) at which the lock will expire locked_by - a hashref of identifying information lockstring - the string that was locked
These are accessors for data supplied to "new".
This method returns the expiration time (as a unix timestamp) as provided to "new" -- unless expiration has been changed. Expiration can be changed by using this method as a mutator:
# expire one hour from now, no matter what initial expiration was $lock->expires(time + 3600);
When updating the expiration time, if the given expiration time is not a valid unix time, or if the expiration cannot be updated, an exception will be raised.
This method returns the lock's globally unique id.
Method to see if the lock is active or not
This method unlocks the lock, deleting the semaphor record. This method is automatically called when locks are garbage collected.
Ricardo SIGNES <cpan@semiotic.systems>
This software is copyright (c) 2022 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install DBIx::Locker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Locker
CPAN shell
perl -MCPAN -e shell install DBIx::Locker
For more information on module installation, please visit the detailed CPAN module installation guide.