diff options
| -rw-r--r-- | docs/disml/Disml/Sharder/Shard/index.html | 2 | ||||
| -rw-r--r-- | docs/disml/Disml__Sharder/Shard/index.html | 2 | ||||
| -rw-r--r-- | lib/sharder.mli | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/docs/disml/Disml/Sharder/Shard/index.html b/docs/disml/Disml/Sharder/Shard/index.html index 3ae7f28..5c68419 100644 --- a/docs/disml/Disml/Sharder/Shard/index.html +++ b/docs/disml/Disml/Sharder/Shard/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Shard (disml.Disml.Sharder.Shard)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">disml</a> » <a href="../../index.html">Disml</a> » <a href="../index.html">Sharder</a> » Shard</nav><h1>Module <code>Sharder.Shard</code></h1><p>Module representing a single shard.</p></header><dl><dt class="spec type" id="type-shard"><a href="#type-shard" class="anchor"></a><code><span class="keyword">type </span>shard</code><code><span class="keyword"> = </span></code><code>{</code><table class="record"><tr id="type-shard.hb_interval" class="anchored"><td class="def field"><a href="#type-shard.hb_interval" class="anchor"></a><code>hb_interval : Core.Time.Span.t Async.Ivar.t;</code></td><td class="doc"><p>Time span between heartbeats, wrapped in an Ivar.</p></td></tr><tr id="type-shard.seq" class="anchored"><td class="def field"><a href="#type-shard.seq" class="anchor"></a><code>seq : int;</code></td><td class="doc"><p>Current sequence number</p></td></tr><tr id="type-shard.session" class="anchored"><td class="def field"><a href="#type-shard.session" class="anchor"></a><code>session : string option;</code></td><td class="doc"><p>Session id, if one exists.</p></td></tr><tr id="type-shard.pipe" class="anchored"><td class="def field"><a href="#type-shard.pipe" class="anchor"></a><code>pipe : Websocket_async.Frame.t Async.Pipe.Reader.t<span class="keyword"> * </span>Websocket_async.Frame.t Async.Pipe.Writer.t;</code></td><td class="doc"><p>Raw frame IO pipe used for websocket communications.</p></td></tr><tr id="type-shard.ready" class="anchored"><td class="def field"><a href="#type-shard.ready" class="anchor"></a><code>ready : unit Async.Ivar.t;</code></td><td class="doc"><p>A simple Ivar indicating if the shard has received READY.</p></td></tr><tr id="type-shard.url" class="anchored"><td class="def field"><a href="#type-shard.url" class="anchor"></a><code>url : string;</code></td><td class="doc"><p>The websocket URL in use.</p></td></tr><tr id="type-shard.id" class="anchored"><td class="def field"><a href="#type-shard.id" class="anchor"></a><code>id : int<span class="keyword"> * </span>int;</code></td><td class="doc"><p>A tuple as expected by Discord. First element is the current shard index, second element is the total shard count.</p></td></tr></table><code>}</code></dt><dd><p>Representation of the state of a shard.</p><p>Wrapper around an internal state, used to wrap <a href="index.html#type-shard"><code>shard</code></a>.</p></dd></dl><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type </span>'a t</code><code><span class="keyword"> = </span></code><code>{</code><table class="record"><tr id="type-t.state" class="anchored"><td class="def field"><a href="#type-t.state" class="anchor"></a><code><span class="keyword">mutable </span>state : <span class="type-var">'a</span>;</code></td></tr></table><code>}</code></dt><dd><p>Wrapper around an internal state, used to wrap <a href="index.html#type-shard"><code>shard</code></a>.</p></dd></dl><dl><dt class="spec value" id="val-heartbeat"><a href="#val-heartbeat" class="anchor"></a><code><span class="keyword">val </span>heartbeat : <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Send a heartbeat to Discord. This is handled automatically.</p></dd></dl><dl><dt class="spec value" id="val-set_status"><a href="#val-set_status" class="anchor"></a><code><span class="keyword">val </span>set_status : status:Yojson.Safe.json <span>-></span> <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Set the status of the shard.</p></dd></dl><dl><dt class="spec value" id="val-request_guild_members"><a href="#val-request_guild_members" class="anchor"></a><code><span class="keyword">val </span>request_guild_members : ?⁠query:string <span>-></span> ?⁠limit:int <span>-></span> guild:<a href="../../Snowflake/index.html#type-t">Snowflake.t</a> <span>-></span> <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Request guild members for the shard's guild. Causes dispatch of multiple <a href="../../Dispatch/index.html#val-members_chunk"><span>member chunk</span></a> events.</p></dd></dl><dl><dt class="spec value" id="val-create"><a href="#val-create" class="anchor"></a><code><span class="keyword">val </span>create : url:string <span>-></span> shards:(int<span class="keyword"> * </span>int) <span>-></span> unit <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Create a new shard</p></dd></dl></div></body></html>
\ No newline at end of file +<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Shard (disml.Disml.Sharder.Shard)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">disml</a> » <a href="../../index.html">Disml</a> » <a href="../index.html">Sharder</a> » Shard</nav><h1>Module <code>Sharder.Shard</code></h1><p>Module representing a single shard.</p></header><dl><dt class="spec type" id="type-shard"><a href="#type-shard" class="anchor"></a><code><span class="keyword">type </span>shard</code><code><span class="keyword"> = </span></code><code>{</code><table class="record"><tr id="type-shard.hb_interval" class="anchored"><td class="def field"><a href="#type-shard.hb_interval" class="anchor"></a><code>hb_interval : Core.Time.Span.t Async.Ivar.t;</code></td><td class="doc"><p>Time span between heartbeats, wrapped in an Ivar.</p></td></tr><tr id="type-shard.seq" class="anchored"><td class="def field"><a href="#type-shard.seq" class="anchor"></a><code>seq : int;</code></td><td class="doc"><p>Current sequence number</p></td></tr><tr id="type-shard.session" class="anchored"><td class="def field"><a href="#type-shard.session" class="anchor"></a><code>session : string option;</code></td><td class="doc"><p>Session id, if one exists.</p></td></tr><tr id="type-shard.pipe" class="anchored"><td class="def field"><a href="#type-shard.pipe" class="anchor"></a><code>pipe : Websocket_async.Frame.t Async.Pipe.Reader.t<span class="keyword"> * </span>Websocket_async.Frame.t Async.Pipe.Writer.t;</code></td><td class="doc"><p>Raw frame IO pipe used for websocket communications.</p></td></tr><tr id="type-shard.ready" class="anchored"><td class="def field"><a href="#type-shard.ready" class="anchor"></a><code>ready : unit Async.Ivar.t;</code></td><td class="doc"><p>A simple Ivar indicating if the shard has received READY.</p></td></tr><tr id="type-shard.url" class="anchored"><td class="def field"><a href="#type-shard.url" class="anchor"></a><code>url : string;</code></td><td class="doc"><p>The websocket URL in use.</p></td></tr><tr id="type-shard.id" class="anchored"><td class="def field"><a href="#type-shard.id" class="anchor"></a><code>id : int<span class="keyword"> * </span>int;</code></td><td class="doc"><p>A tuple as expected by Discord. First element is the current shard index, second element is the total shard count.</p></td></tr></table><code>}</code></dt><dd><p>Representation of the state of a shard.</p></dd></dl><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type </span>'a t</code><code><span class="keyword"> = </span></code><code>{</code><table class="record"><tr id="type-t.state" class="anchored"><td class="def field"><a href="#type-t.state" class="anchor"></a><code><span class="keyword">mutable </span>state : <span class="type-var">'a</span>;</code></td></tr></table><code>}</code></dt><dd><p>Wrapper around an internal state, used to wrap <a href="index.html#type-shard"><code>shard</code></a>.</p></dd></dl><dl><dt class="spec value" id="val-heartbeat"><a href="#val-heartbeat" class="anchor"></a><code><span class="keyword">val </span>heartbeat : <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Send a heartbeat to Discord. This is handled automatically.</p></dd></dl><dl><dt class="spec value" id="val-set_status"><a href="#val-set_status" class="anchor"></a><code><span class="keyword">val </span>set_status : status:Yojson.Safe.json <span>-></span> <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Set the status of the shard.</p></dd></dl><dl><dt class="spec value" id="val-request_guild_members"><a href="#val-request_guild_members" class="anchor"></a><code><span class="keyword">val </span>request_guild_members : ?⁠query:string <span>-></span> ?⁠limit:int <span>-></span> guild:<a href="../../Snowflake/index.html#type-t">Snowflake.t</a> <span>-></span> <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Request guild members for the shard's guild. Causes dispatch of multiple <a href="../../Dispatch/index.html#val-members_chunk"><span>member chunk</span></a> events.</p></dd></dl><dl><dt class="spec value" id="val-create"><a href="#val-create" class="anchor"></a><code><span class="keyword">val </span>create : url:string <span>-></span> shards:(int<span class="keyword"> * </span>int) <span>-></span> unit <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Create a new shard</p></dd></dl></div></body></html>
\ No newline at end of file diff --git a/docs/disml/Disml__Sharder/Shard/index.html b/docs/disml/Disml__Sharder/Shard/index.html index e75a3f8..dd012b2 100644 --- a/docs/disml/Disml__Sharder/Shard/index.html +++ b/docs/disml/Disml__Sharder/Shard/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Shard (disml.Disml__Sharder.Shard)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">disml</a> » <a href="../index.html">Disml__Sharder</a> » Shard</nav><h1>Module <code>Disml__Sharder.Shard</code></h1><p>Module representing a single shard.</p></header><dl><dt class="spec type" id="type-shard"><a href="#type-shard" class="anchor"></a><code><span class="keyword">type </span>shard</code><code><span class="keyword"> = </span></code><code>{</code><table class="record"><tr id="type-shard.hb_interval" class="anchored"><td class="def field"><a href="#type-shard.hb_interval" class="anchor"></a><code>hb_interval : Core.Time.Span.t Async.Ivar.t;</code></td><td class="doc"><p>Time span between heartbeats, wrapped in an Ivar.</p></td></tr><tr id="type-shard.seq" class="anchored"><td class="def field"><a href="#type-shard.seq" class="anchor"></a><code>seq : int;</code></td><td class="doc"><p>Current sequence number</p></td></tr><tr id="type-shard.session" class="anchored"><td class="def field"><a href="#type-shard.session" class="anchor"></a><code>session : string option;</code></td><td class="doc"><p>Session id, if one exists.</p></td></tr><tr id="type-shard.pipe" class="anchored"><td class="def field"><a href="#type-shard.pipe" class="anchor"></a><code>pipe : Websocket_async.Frame.t Async.Pipe.Reader.t<span class="keyword"> * </span>Websocket_async.Frame.t Async.Pipe.Writer.t;</code></td><td class="doc"><p>Raw frame IO pipe used for websocket communications.</p></td></tr><tr id="type-shard.ready" class="anchored"><td class="def field"><a href="#type-shard.ready" class="anchor"></a><code>ready : unit Async.Ivar.t;</code></td><td class="doc"><p>A simple Ivar indicating if the shard has received READY.</p></td></tr><tr id="type-shard.url" class="anchored"><td class="def field"><a href="#type-shard.url" class="anchor"></a><code>url : string;</code></td><td class="doc"><p>The websocket URL in use.</p></td></tr><tr id="type-shard.id" class="anchored"><td class="def field"><a href="#type-shard.id" class="anchor"></a><code>id : int<span class="keyword"> * </span>int;</code></td><td class="doc"><p>A tuple as expected by Discord. First element is the current shard index, second element is the total shard count.</p></td></tr></table><code>}</code></dt><dd><p>Representation of the state of a shard.</p><p>Wrapper around an internal state, used to wrap <a href="index.html#type-shard"><code>shard</code></a>.</p></dd></dl><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type </span>'a t</code><code><span class="keyword"> = </span></code><code>{</code><table class="record"><tr id="type-t.state" class="anchored"><td class="def field"><a href="#type-t.state" class="anchor"></a><code><span class="keyword">mutable </span>state : <span class="type-var">'a</span>;</code></td></tr></table><code>}</code></dt><dd><p>Wrapper around an internal state, used to wrap <a href="index.html#type-shard"><code>shard</code></a>.</p></dd></dl><dl><dt class="spec value" id="val-heartbeat"><a href="#val-heartbeat" class="anchor"></a><code><span class="keyword">val </span>heartbeat : <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Send a heartbeat to Discord. This is handled automatically.</p></dd></dl><dl><dt class="spec value" id="val-set_status"><a href="#val-set_status" class="anchor"></a><code><span class="keyword">val </span>set_status : status:Yojson.Safe.json <span>-></span> <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Set the status of the shard.</p></dd></dl><dl><dt class="spec value" id="val-request_guild_members"><a href="#val-request_guild_members" class="anchor"></a><code><span class="keyword">val </span>request_guild_members : ?⁠query:string <span>-></span> ?⁠limit:int <span>-></span> guild:<a href="../../Disml/Snowflake/index.html#type-t">Disml.Snowflake.t</a> <span>-></span> <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Request guild members for the shard's guild. Causes dispatch of multiple <span class="xref-unresolved" title="unresolved reference to "Dispatch.members_chunk""><span>member chunk</span></span> events.</p></dd></dl><dl><dt class="spec value" id="val-create"><a href="#val-create" class="anchor"></a><code><span class="keyword">val </span>create : url:string <span>-></span> shards:(int<span class="keyword"> * </span>int) <span>-></span> unit <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Create a new shard</p></dd></dl></div></body></html>
\ No newline at end of file +<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Shard (disml.Disml__Sharder.Shard)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">disml</a> » <a href="../index.html">Disml__Sharder</a> » Shard</nav><h1>Module <code>Disml__Sharder.Shard</code></h1><p>Module representing a single shard.</p></header><dl><dt class="spec type" id="type-shard"><a href="#type-shard" class="anchor"></a><code><span class="keyword">type </span>shard</code><code><span class="keyword"> = </span></code><code>{</code><table class="record"><tr id="type-shard.hb_interval" class="anchored"><td class="def field"><a href="#type-shard.hb_interval" class="anchor"></a><code>hb_interval : Core.Time.Span.t Async.Ivar.t;</code></td><td class="doc"><p>Time span between heartbeats, wrapped in an Ivar.</p></td></tr><tr id="type-shard.seq" class="anchored"><td class="def field"><a href="#type-shard.seq" class="anchor"></a><code>seq : int;</code></td><td class="doc"><p>Current sequence number</p></td></tr><tr id="type-shard.session" class="anchored"><td class="def field"><a href="#type-shard.session" class="anchor"></a><code>session : string option;</code></td><td class="doc"><p>Session id, if one exists.</p></td></tr><tr id="type-shard.pipe" class="anchored"><td class="def field"><a href="#type-shard.pipe" class="anchor"></a><code>pipe : Websocket_async.Frame.t Async.Pipe.Reader.t<span class="keyword"> * </span>Websocket_async.Frame.t Async.Pipe.Writer.t;</code></td><td class="doc"><p>Raw frame IO pipe used for websocket communications.</p></td></tr><tr id="type-shard.ready" class="anchored"><td class="def field"><a href="#type-shard.ready" class="anchor"></a><code>ready : unit Async.Ivar.t;</code></td><td class="doc"><p>A simple Ivar indicating if the shard has received READY.</p></td></tr><tr id="type-shard.url" class="anchored"><td class="def field"><a href="#type-shard.url" class="anchor"></a><code>url : string;</code></td><td class="doc"><p>The websocket URL in use.</p></td></tr><tr id="type-shard.id" class="anchored"><td class="def field"><a href="#type-shard.id" class="anchor"></a><code>id : int<span class="keyword"> * </span>int;</code></td><td class="doc"><p>A tuple as expected by Discord. First element is the current shard index, second element is the total shard count.</p></td></tr></table><code>}</code></dt><dd><p>Representation of the state of a shard.</p></dd></dl><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type </span>'a t</code><code><span class="keyword"> = </span></code><code>{</code><table class="record"><tr id="type-t.state" class="anchored"><td class="def field"><a href="#type-t.state" class="anchor"></a><code><span class="keyword">mutable </span>state : <span class="type-var">'a</span>;</code></td></tr></table><code>}</code></dt><dd><p>Wrapper around an internal state, used to wrap <a href="index.html#type-shard"><code>shard</code></a>.</p></dd></dl><dl><dt class="spec value" id="val-heartbeat"><a href="#val-heartbeat" class="anchor"></a><code><span class="keyword">val </span>heartbeat : <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Send a heartbeat to Discord. This is handled automatically.</p></dd></dl><dl><dt class="spec value" id="val-set_status"><a href="#val-set_status" class="anchor"></a><code><span class="keyword">val </span>set_status : status:Yojson.Safe.json <span>-></span> <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Set the status of the shard.</p></dd></dl><dl><dt class="spec value" id="val-request_guild_members"><a href="#val-request_guild_members" class="anchor"></a><code><span class="keyword">val </span>request_guild_members : ?⁠query:string <span>-></span> ?⁠limit:int <span>-></span> guild:<a href="../../Disml/Snowflake/index.html#type-t">Disml.Snowflake.t</a> <span>-></span> <a href="index.html#type-shard">shard</a> <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Request guild members for the shard's guild. Causes dispatch of multiple <span class="xref-unresolved" title="unresolved reference to "Dispatch.members_chunk""><span>member chunk</span></span> events.</p></dd></dl><dl><dt class="spec value" id="val-create"><a href="#val-create" class="anchor"></a><code><span class="keyword">val </span>create : url:string <span>-></span> shards:(int<span class="keyword"> * </span>int) <span>-></span> unit <span>-></span> <a href="index.html#type-shard">shard</a> Async.Deferred.t</code></dt><dd><p>Create a new shard</p></dd></dl></div></body></html>
\ No newline at end of file diff --git a/lib/sharder.mli b/lib/sharder.mli index aa040f9..86a0da0 100644 --- a/lib/sharder.mli +++ b/lib/sharder.mli @@ -27,6 +27,7 @@ module Shard : sig url: string; (** The websocket URL in use. *) id: int * int; (** A tuple as expected by Discord. First element is the current shard index, second element is the total shard count. *) } + (** Wrapper around an internal state, used to wrap {!shard}. *) type 'a t = { mutable state: 'a; |