package octez-smart-rollup-node-lib

  1. Overview
  2. Docs
On This Page
  1. Lock files
Legend:
Library
Module
Module type
Parameter
Class
Class type

A map addressed by (protocol agnostic) DAC reveal hashes.

val dictionary_encoding : keys:'k list -> string_of_key:('k -> string) -> key_of_string:(string -> 'k) -> value_encoding:('k -> 'v Tezos_base.TzPervasives.Data_encoding.t) -> ('k * 'v) list Tezos_base.TzPervasives.Data_encoding.t

dictionary_encoding keys string_of_key key_of_string value_encoding: a json only encoding of a (key, 'value) list. JSON is of the form

{ "k1" : v1,
  "k2" : v2,
  "k3" : v3 }

Lock files

lock path acquires a lock on the file path and returns the opened file descriptor (for unlocking). If there is already a lock on path, this function call is blocking until the previous lock is released.

val unlock : Lwt_unix.file_descr -> unit Lwt.t

unlock fd releases the lock on the opened file descriptor fd. If there is no lock or if it is already released, this function does nothing.

val with_lockfile : string -> (unit -> 'a Tezos_base.TzPervasives.tzresult Lwt.t) -> 'a Tezos_base.TzPervasives.tzresult Lwt.t

with_lockfile path f executes the function f by taking a lock on the file path. If there is already a lock on path, the execution of f is blocking until the previous lock is released.

OCaml

Innovation. Community. Security.