DBIx::Locker::Lock - a live resource lock
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->expired(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 <email@example.com>
This software is copyright (c) 2014 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.