nanoev/trace/Trace_subscriber/Subscriber/index.html
2025-05-30 19:31:31 +00:00

2 lines
3.3 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>Subscriber (trace.Trace_subscriber.Subscriber)</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">trace</a> &#x00BB; <a href="../index.html">Trace_subscriber</a> &#x00BB; Subscriber</nav><header class="odoc-preamble"><h1>Module <code><span>Trace_subscriber.Subscriber</span></code></h1><p>Trace subscribers</p></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></code><ol><li id="type-t.Sub" class="def variant constructor anchored"><a href="#type-t.Sub" class="anchor"></a><code><span>| </span><span><span class="constructor">Sub</span> : </span><span>{</span></code><ol><li id="type-t.st" class="def record field anchored"><a href="#type-t.st" class="anchor"></a><code><span>st : <span class="type-var">'st</span>;</span></code></li><li id="type-t.callbacks" class="def record field anchored"><a href="#type-t.callbacks" class="anchor"></a><code><span>callbacks : <span><span class="type-var">'st</span> <a href="../Callbacks/index.html#type-t">Callbacks.t</a></span>;</span></code></li></ol><code><span>}</span><span> <span class="arrow">&#45;&gt;</span> <a href="#type-t">t</a></span></code></li></ol></div><div class="spec-doc"><p>A trace subscriber. It pairs a set of callbacks with the state they need (which can contain a file handle, a socket to write events to, config, etc.).</p><p>The design goal for this is that it should be possible to avoid allocations whenever the trace collector invokes the callbacks.</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 class="spec-doc"><p>Dummy subscriber that ignores every call.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-tee_l"><a href="#val-tee_l" class="anchor"></a><code><span><span class="keyword">val</span> tee_l : <span><span><a href="#type-t">t</a> list</span> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Tee multiple subscribers, ie return a subscriber that forwards to all the subscribers in <code>subs</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-tee"><a href="#val-tee" class="anchor"></a><code><span><span class="keyword">val</span> tee : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>tee s1 s2</code> is a subscriber that forwards every call to <code>s1</code> and <code>s2</code> both.</p></div></div></div></body></html>