Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the IO-All CPAN distribution.

Report information
The Basics
Id: 87070
Status: rejected
Priority: 0/
Queue: IO-All

People
Owner: Nobody in particular
Requestors: josh.anderson [...] me.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: A non-blocking version of lock() would be nice
I'd like to use IO::All for a cronjob lockfile. The job will be running every five minutes, and the fact that lock() always blocks means that if a run takes more than five minutes, subsequent runs will stack up behind it, waiting to acquire the lock, which I don't want happening. I think that a lock_nb() method would be a perfect fit for this use case. E.g.,: my $lockfile = io("/path/to/file")->assert->lock_nb < "$$" || exit; # Or die() if appropriate Yes, I could just use flock() directly or another module like Lock::File, but this seems like something IO::All should be able to do. =)