|o||OO interface only|
Autoretry (by default for 60s) when trying to acquire lock
I prefer this approach to blocking/waiting indefinitely or failing immediately.
CW$lock = File::Flock::Retry->lock($path, \%opts)Attempt to acquire an exclusive lock on $path. $path will be created if not already exists. If $path is already locked by another process, will retry every second for a number of seconds (by default 60). Will die if failed to acquire lock after all retries.
o retries => int (default: 60)
Number of retries (equals number of seconds, since retry is done every second).
o shared => bool (default: 0)
CW$lock->releaseSynonym for unlock().
Not yet tested on Windows. Some filesystems do not support inode?
File::Flock::Tiny which is also tiny, but does not have the autoremove and autoretry capability which I want. See also: https://github.com/trinitum/perl-File-Flock-Tiny/issues/1
flock() Perl function.
Please visit the projects homepage at <https://metacpan.org/release/File-Flock-Retry>.
Source repository is at <https://github.com/perlancar/perl-File-Flock-Retry>.
Please report any bugs or feature requests on the bugtracker website <https://rt.cpan.org/Public/Dist/Display.html?Name=File-Flock-Retry>
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
This software is copyright (c) 2015 by firstname.lastname@example.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
|perl v5.20.3||FILE::FLOCK::RETRY (3)||2015-10-22|