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.tcreate ?message pathtries to create a file atpathcontaining 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.tcreate_exn ?message pathis likecreateexcept 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.twaiting_create pathrepeatedly tries to lockpath, becoming determined whenpathis locked or raising whenabortbecomes determined. Similar toLock_file_blocking.create.
val is_locked : string -> bool Async.Deferred.tis_locked pathreturns true when the file atpathexists and is locked, false otherwise.
module Nfs : sig ... endNfshas analogs of functions inLock_file_blocking.Nfs; see there for documentation. In addition to addingDeferred's,blocking_createwas renamedwaiting_createto avoid the impression that it blocks Async.
module Flock : sig ... end