Skip to content

Commit

Permalink
deploy: 7b3f621
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Mar 20, 2024
1 parent 8774fcf commit 08f86bb
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 15 deletions.
2 changes: 1 addition & 1 deletion moonpool-lwt/Moonpool_lwt/index.html

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions moonpool-lwt/_doc-dir/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@

# 0.6

- breaking: remove `Immediate_runner` (bug prone and didn't
handle effects). `Moonpool_fib.main` can be used to handle
effects in the main function.
- remove deprecated alias `Moonpool.Pool`

- feat: add structured concurrency sub-library `moonpool.fib` with
fibers. Fibers can use `await` and spawn other fibers that will
be appropriately cancelled when their parent is.
- feat: add add `moonpool-lwt` as an experimental bridge between moonpool and lwt.
This allows moonpool runners to be used from within Lwt to
perform background computations, and conversely to call Lwt from
moonpool with some precautions.
- feat: task-local storage in the main moonpool runners, available from
fibers and regular tasks.
- feat: add `Exn_bt` to core
- feat: add `Runner.dummy`
- make `moonpool.forkjoin` optional (only on OCaml >= 5.0)
- feat: add `Fut.Advanced.barrier_on_abstract_container_of_futures`
- feat: add `Fut.map_list`

- refactor: split off domain pool to `moonpool.dpool`
- fix too early exit in Ws_pool

# 0.5.1

- fix `Ws_pool`: workers would exit before processing
Expand Down
2 changes: 1 addition & 1 deletion moonpool/Moonpool/Background_thread/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion moonpool/Moonpool/Exn_bt/index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Exn_bt (moonpool.Moonpool.Exn_bt)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">moonpool</a> &#x00BB; <a href="../index.html">Moonpool</a> &#x00BB; Exn_bt</nav><header class="odoc-preamble"><h1>Module <code><span>Moonpool.Exn_bt</span></code></h1><p>Exception with backtrace.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> NEXT_RELEASE</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = exn * <a href="../../../ocaml/Stdlib/Printexc/index.html#type-raw_backtrace">Stdlib.Printexc.raw_backtrace</a></span></code></div><div class="spec-doc"><p>An exception bundled with a backtrace</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-exn"><a href="#val-exn" class="anchor"></a><code><span><span class="keyword">val</span> exn : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> exn</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-bt"><a href="#val-bt" class="anchor"></a><code><span><span class="keyword">val</span> bt : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../../../ocaml/Stdlib/Printexc/index.html#type-raw_backtrace">Stdlib.Printexc.raw_backtrace</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make : <span>exn <span class="arrow">&#45;&gt;</span></span> <span><a href="../../../ocaml/Stdlib/Printexc/index.html#type-raw_backtrace">Stdlib.Printexc.raw_backtrace</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Trivial builder</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span>exn <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>get exn</code> is <code>make exn (get_raw_backtrace ())</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_callstack"><a href="#val-get_callstack" class="anchor"></a><code><span><span class="keyword">val</span> get_callstack : <span>int <span class="arrow">&#45;&gt;</span></span> <span>exn <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-raise"><a href="#val-raise" class="anchor"></a><code><span><span class="keyword">val</span> raise : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p>Raise the exception with its save backtrace</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-show"><a href="#val-show" class="anchor"></a><code><span><span class="keyword">val</span> show : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Simple printing</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-result"><a href="#type-result" class="anchor"></a><code><span><span class="keyword">type</span> <span class="keyword">nonrec</span> <span>'a result</span></span><span> = <span><span>(<span class="type-var">'a</span>, <a href="#type-t">t</a>)</span> <a href="../../../ocaml/Stdlib/index.html#type-result">result</a></span></span></code></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Exn_bt (moonpool.Moonpool.Exn_bt)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">moonpool</a> &#x00BB; <a href="../index.html">Moonpool</a> &#x00BB; Exn_bt</nav><header class="odoc-preamble"><h1>Module <code><span>Moonpool.Exn_bt</span></code></h1><p>Exception with backtrace.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.6</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = exn * <a href="../../../ocaml/Stdlib/Printexc/index.html#type-raw_backtrace">Stdlib.Printexc.raw_backtrace</a></span></code></div><div class="spec-doc"><p>An exception bundled with a backtrace</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-exn"><a href="#val-exn" class="anchor"></a><code><span><span class="keyword">val</span> exn : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> exn</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-bt"><a href="#val-bt" class="anchor"></a><code><span><span class="keyword">val</span> bt : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../../../ocaml/Stdlib/Printexc/index.html#type-raw_backtrace">Stdlib.Printexc.raw_backtrace</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make : <span>exn <span class="arrow">&#45;&gt;</span></span> <span><a href="../../../ocaml/Stdlib/Printexc/index.html#type-raw_backtrace">Stdlib.Printexc.raw_backtrace</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Trivial builder</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span>exn <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>get exn</code> is <code>make exn (get_raw_backtrace ())</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_callstack"><a href="#val-get_callstack" class="anchor"></a><code><span><span class="keyword">val</span> get_callstack : <span>int <span class="arrow">&#45;&gt;</span></span> <span>exn <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-raise"><a href="#val-raise" class="anchor"></a><code><span><span class="keyword">val</span> raise : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p>Raise the exception with its save backtrace</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-show"><a href="#val-show" class="anchor"></a><code><span><span class="keyword">val</span> show : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Simple printing</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-result"><a href="#type-result" class="anchor"></a><code><span><span class="keyword">type</span> <span class="keyword">nonrec</span> <span>'a result</span></span><span> = <span><span>(<span class="type-var">'a</span>, <a href="#type-t">t</a>)</span> <a href="../../../ocaml/Stdlib/index.html#type-result">result</a></span></span></code></div></div></div></body></html>
4 changes: 2 additions & 2 deletions moonpool/Moonpool/Fifo_pool/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion moonpool/Moonpool/Fut/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion moonpool/Moonpool/Immediate_runner/index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Immediate_runner (moonpool.Moonpool.Immediate_runner)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">moonpool</a> &#x00BB; <a href="../index.html">Moonpool</a> &#x00BB; Immediate_runner</nav><header class="odoc-preamble"><h1>Module <code><span>Moonpool.Immediate_runner</span></code></h1><p>Runner that runs tasks in the caller thread.</p><p>This is removed since NEXT_RELEASE, and replaced by <a href="../../Moonpool_fib/Main/index.html"><code>Moonpool_fib.Main</code></a>.</p><ul class="at-tags"><li class="deprecated"><span class="at-tag">deprecated</span> use Moonpool_fib.Main</li></ul></header><div class="odoc-content"></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Immediate_runner (moonpool.Moonpool.Immediate_runner)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">moonpool</a> &#x00BB; <a href="../index.html">Moonpool</a> &#x00BB; Immediate_runner</nav><header class="odoc-preamble"><h1>Module <code><span>Moonpool.Immediate_runner</span></code></h1><p>Runner that runs tasks in the caller thread.</p><p>This is removed since 0.6, and replaced by <a href="../../Moonpool_fib/Main/index.html"><code>Moonpool_fib.Main</code></a>.</p><ul class="at-tags"><li class="deprecated"><span class="at-tag">deprecated</span> use Moonpool_fib.Main</li></ul></header><div class="odoc-content"></div></body></html>
2 changes: 1 addition & 1 deletion moonpool/Moonpool/Runner/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion moonpool/Moonpool/Task_local_storage/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Task_local_storage (moonpool.Moonpool.Task_local_storage)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">moonpool</a> &#x00BB; <a href="../index.html">Moonpool</a> &#x00BB; Task_local_storage</nav><header class="odoc-preamble"><h1>Module <code><span>Moonpool.Task_local_storage</span></code></h1><p>Task-local storage.</p><p>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.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> NEXT_RELEASE</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = <span class="xref-unresolved">Moonpool__</span>.Types_.local_storage</span></code></div><div class="spec-doc"><p>Underlying storage for a task. This is mutable and not thread-safe.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dummy"><a href="#val-dummy" class="anchor"></a><code><span><span class="keyword">val</span> dummy : <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-key"><a href="#type-key" class="anchor"></a><code><span><span class="keyword">type</span> <span>'a key</span></span></code></div><div class="spec-doc"><p>A key used to access a particular (typed) storage slot on every task.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-new_key"><a href="#val-new_key" class="anchor"></a><code><span><span class="keyword">val</span> new_key : <span><span class="label">init</span>:<span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span>unit <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="#type-key">key</a></span></span></code></div><div class="spec-doc"><p><code>new_key ~init ()</code> makes a new key. Keys are expensive and should never be allocated dynamically or in a loop. The correct pattern is, at toplevel:</p><pre class="language-ocaml"><code> let k_foo : foo Task_ocal_storage.key =
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Task_local_storage (moonpool.Moonpool.Task_local_storage)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">moonpool</a> &#x00BB; <a href="../index.html">Moonpool</a> &#x00BB; Task_local_storage</nav><header class="odoc-preamble"><h1>Module <code><span>Moonpool.Task_local_storage</span></code></h1><p>Task-local storage.</p><p>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.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.6</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = <span class="xref-unresolved">Moonpool__</span>.Types_.local_storage</span></code></div><div class="spec-doc"><p>Underlying storage for a task. This is mutable and not thread-safe.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dummy"><a href="#val-dummy" class="anchor"></a><code><span><span class="keyword">val</span> dummy : <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-key"><a href="#type-key" class="anchor"></a><code><span><span class="keyword">type</span> <span>'a key</span></span></code></div><div class="spec-doc"><p>A key used to access a particular (typed) storage slot on every task.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-new_key"><a href="#val-new_key" class="anchor"></a><code><span><span class="keyword">val</span> new_key : <span><span class="label">init</span>:<span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span>unit <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="#type-key">key</a></span></span></code></div><div class="spec-doc"><p><code>new_key ~init ()</code> makes a new key. Keys are expensive and should never be allocated dynamically or in a loop. The correct pattern is, at toplevel:</p><pre class="language-ocaml"><code> let k_foo : foo Task_ocal_storage.key =
Task_local_storage.new_key ~init:(fun () -&gt; make_foo ()) ()

(* … *)
Expand Down
Loading

0 comments on commit 08f86bb

Please sign in to comment.