mirror of
https://github.com/c-cube/nanoev.git
synced 2025-12-06 03:05:32 -05:00
2 lines
3.3 KiB
HTML
2 lines
3.3 KiB
HTML
<!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> » <a href="../../index.html">trace</a> » <a href="../index.html">Trace_subscriber</a> » 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">-></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">-></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">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></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>
|