Etcd-Lock

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


SYNOPSIS
      use Etcd::Lock

      my $etcdLock = Etcd::Lock->new(host => 'host.name.com', key => 'lock_key');
      $etcdLock->lock();
      ... do_something ...
      $etcdLock->unlock();

DESCRIPTION
    Etcd::Lock is a lock based on etcd. When a key is locked, try to lock
    same key return false. Key is unlocked automatically when ttl seconds
    expired.

METHODS
  lock()
    Return true if key is unlocked. Now it's locked.

  unlock()
    Return true if key is locked. Now it's unlocked

  ttl(new_ttl)
    Set or return after how many seconds a lock is automatically removed.
    Defaul: 3600.

BUGS/CONTRIBUTING
    Please report any bugs through the web interface at
    <https://github.com/EmilianoBruni/etcd-lock/issues>

    If you want to contribute changes or otherwise involve yourself in

lib/Etcd/Lock.pm  view on Meta::CPAN


  use Etcd::Lock

  my $etcdLock = Etcd::Lock->new(host => 'host.name.com', key => 'lock_key');
  $etcdLock->lock();
  ... do_something ...
  $etcdLock->unlock();

=head1 DESCRIPTION

Etcd::Lock is a lock based on etcd. When a key is locked, try to lock same key
return false. Key is unlocked automatically when ttl seconds expired.

=encoding UTF-8

=head1 METHODS

=head2 lock()

Return true if key is unlocked. Now it's locked.

=head2 unlock()

Return true if key is locked. Now it's unlocked

=head2 ttl(new_ttl)

Set or return after how many seconds a lock is automatically removed.
Defaul: 3600.

=head1 BUGS/CONTRIBUTING

Please report any bugs through the web interface at L<https://github.com/EmilianoBruni/etcd-lock/issues>



( run in 0.591 second using v1.01-cache-2.11-cpan-49f99fa48dc )