IPC-Lock-WithTTL
view release on metacpan - search on metacpan
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;
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.088 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )