package picos

  1. Overview
  2. Docs

Domain-local storage for Picos.

ℹ️ On OCaml 4 there is always only a single domain.

type 'a key

Represents a key for storing values of type 'a in storage associated with domains.

val new_key : (unit -> 'a) -> 'a key

new_key compute allocates a new key for associating values in storage associated with domains. The initial value for each domain is computed by calling the given function if the key is read before it has been written. The compute function might be called multiple times per domain, but only one result will be used.

val get : 'a key -> 'a

get key returns the value associated with the key in the storage associated with the current domain.

val set : 'a key -> 'a -> unit

set key value sets the value associated with the key in the storage associated with the current domain.

OCaml

Innovation. Community. Security.