NAME
IO::Lambda::Flock - lambda-style file locking
DESCRIPTION
The module implements a non-blocking flock(2) wrapper by polling
SYNOPSIS
API
- flock($filehandle, %options) -> ($lock_obtained = 1 | $timeout = 0)
-
Waits for lock to be obtained, or expired. If succeeds, the (shared or exclusive) lock is already obtained by
flock($filehandle, LOCK_NB)
call. Options:timeout
ordeadline
-
These two options are synonyms, both declare when the waiting for the lock should give up. If undef, timeout never occurs.
-
If set,
LOCK_SH
is used, otherwiseLOCK_EX
. - frequency
-
Defines how often the polling for lock release should occur. If left undefined, polling occurs in idle time, when the other events are dispatched.
SEE ALSO
AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>.