Ricardo SIGNES > DBIx-Locker-0.100117 > DBIx::Locker::Lock

Download:
DBIx-Locker-0.100117.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.100117   Source  

NAME ^

DBIx::Locker::Lock - a live resource lock

VERSION ^

version 0.100117

METHODS ^

new

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

locker

lock_id

locked_by

lockstring

These are accessors for data supplied to "new".

expires

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.

guid

This method returns the lock's globally unique id.

is_locked

Method to see if the lock is active or not

unlock

This method unlocks the lock, deleting the semaphor record. This method is automatically called when locks are garbage collected.

AUTHOR ^

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: