package moonpool

  1. Overview
  2. Docs
Pools of threads supported by a pool of domains

Install

Dune Dependency

Authors

Maintainers

Sources

moonpool-0.8.tbz
sha256=2c10792726b1c2e4987f0f2acca5c5c221ea5cc0a2b4c75ad4fd2709e32aab6f
sha512=801c399ae9b72dd5f84624cdee9bcbb56c5ed9c371001e00176e685686234b4135d69e48877412b25a5127ad59b729000d5422dad0c90e2ded2744b974dddeca

doc/moonpool/Moonpool/Task_local_storage/index.html

Module Moonpool.Task_local_storageSource

Task-local storage.

This storage is associated to the current task, just like thread-local storage is associated with the current thread. The storage is carried along in case the current task is suspended.

  • since 0.6
Sourceval create : unit -> 'a t

create () makes a new key. Keys are expensive and should never be allocated dynamically or in a loop.

Sourceexception Not_set
Sourceval get_exn : 'a t -> 'a

get k gets the value for the current task for key k. Must be run from inside a task running on a runner.

Sourceval get_opt : 'a t -> 'a option

get_opt k gets the current task's value for key k, or None if not run from inside the task.

Sourceval get : 'a t -> default:'a -> 'a
Sourceval set : 'a t -> 'a -> unit

set k v sets the storage for k to v. Must be run from inside a task running on a runner.

Sourceval with_value : 'a t -> 'a -> (unit -> 'b) -> 'b

with_value k v f sets k to v for the duration of the call to f(). When f() returns (or fails), k is restored to its old value.

Local Hmap.t

This requires hmap to be installed.

OCaml

Innovation. Community. Security.

On This Page
  1. Local Hmap.t