IPC-Lock-WithTTL

 view release on metacpan or  search on metacpan

lib/IPC/Lock/WithTTL.pm  view on Meta::CPAN


sub release {
    args(my $self);

    $self->update_heartbeat(pid => 0);
    undef $self->{_fh};

    return 1;
}

sub update_heartbeat {
    args(my $self,
         my $pid => { isa => 'Int', default => $$ },
       );

    my $fh = $self->_fh;

    my $expiration = time() + $self->ttl;

    seek $fh, 0, SEEK_SET;
    truncate $fh, 0;



( run in 0.282 second using v1.01-cache-2.11-cpan-95122f20152 )