Module Lock_file_async
Lock_file_async
is a wrapper that provides Async equivalents for Lock_file_blocking
.
val create : ?message:string -> ?close_on_exec:bool -> ?unlink_on_exit:bool -> string -> bool Async.Deferred.t
create ?message path
tries to create a file atpath
containing the textmessage
, pid if none provided. It returns true on success, false on failure. Note: there is no way to release the lock or the fd created inside! It will only be released when the process dies.
val create_exn : ?message:string -> ?close_on_exec:bool -> ?unlink_on_exit:bool -> string -> unit Async.Deferred.t
create_exn ?message path
is likecreate
except that it throws an exception on failure instead of returning a boolean value.
val waiting_create : ?abort:unit Async.Deferred.t -> ?message:string -> ?close_on_exec:bool -> ?unlink_on_exit:bool -> string -> unit Async.Deferred.t
waiting_create path
repeatedly tries to lockpath
, becoming determined whenpath
is locked or raising whenabort
becomes determined. Similar toLock_file_blocking
.create.
val is_locked : string -> bool Async.Deferred.t
is_locked path
returns true when the file atpath
exists and is locked, false otherwise.
module Nfs : sig ... end
Nfs
has analogs of functions inLock_file_blocking
.Nfs; see there for documentation. In addition to addingDeferred
's,blocking_create
was renamedwaiting_create
to avoid the impression that it blocks Async.
module Flock : sig ... end