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 or deadline

These two options are synonyms, both declare when the waiting for the lock should give up. If undef, timeout never occurs.

shared

If set, LOCK_SH is used, otherwise LOCK_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

Fcntl, IO::Lambda::Poll.

AUTHOR

Dmitry Karasik, <dmitry@karasik.eu.org>.