tiny_httpd/ocaml/Runtime_events/User/index.html
2025-03-21 12:40:14 +00:00

2 lines
3.8 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>User (ocaml.Runtime_events.User)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.0.0"/><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">Index</a> &#x00BB; <a href="../../index.html">ocaml</a> &#x00BB; <a href="../index.html">Runtime_events</a> &#x00BB; User</nav><header class="odoc-preamble"><h1>Module <code><span>Runtime_events.User</span></code></h1><p>User events is a way for libraries to provide runtime events that can be consumed by other tools. These events can carry known data types or custom values. The current maximum number of user events is 8192.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-tag"><a href="#type-tag" class="anchor"></a><code><span><span class="keyword">type</span> tag</span><span> = </span><span>..</span></code></div><div class="spec-doc"><p>The type for a user event tag. Tags are used to discriminate between user events of the same type.</p></div></div><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> <span>'value t</span></span></code></div><div class="spec-doc"><p>The type for a user event. User events describe their tag, carried data type and an unique string-based name.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-register"><a href="#val-register" class="anchor"></a><code><span><span class="keyword">val</span> register : <span>string <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-tag">tag</a> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'value</span> <a href="../Type/index.html#type-t">Type.t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'value</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>register name tag ty</code> registers a new event with an unique <code>name</code>, carrying a <code>tag</code> and values of type <code>ty</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-write"><a href="#val-write" class="anchor"></a><code><span><span class="keyword">val</span> write : <span><span><span class="type-var">'value</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'value</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>write t v</code> emits value <code>v</code> for event <code>t</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-name"><a href="#val-name" class="anchor"></a><code><span><span class="keyword">val</span> name : <span><span><span class="type-var">_</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p><code>name t</code> is the unique identifying name of event <code>t</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-tag"><a href="#val-tag" class="anchor"></a><code><span><span class="keyword">val</span> tag : <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <a href="#type-tag">tag</a></span></code></div><div class="spec-doc"><p><code>tag t</code> is the associated tag of event <code>t</code>, when it is known. An event can be unknown if it was not registered in the consumer program.</p></div></div></div></body></html>