aboutsummaryrefslogtreecommitdiff
path: root/lib/event.mli
diff options
context:
space:
mode:
authorAdelyn Breelove <[email protected]>2019-01-21 12:14:58 -0700
committerAdelyn Breelove <[email protected]>2019-01-21 12:14:58 -0700
commitef93c7448f6c74ec20bd7846cb324b836bb2e222 (patch)
tree5ed470e09b45279a07202ea22d62dc9ef2935724 /lib/event.mli
parentFinalize signatures (diff)
downloaddisml-ef93c7448f6c74ec20bd7846cb324b836bb2e222.tar.xz
disml-ef93c7448f6c74ec20bd7846cb324b836bb2e222.zip
More signature improvements
Diffstat (limited to 'lib/event.mli')
-rw-r--r--lib/event.mli7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/event.mli b/lib/event.mli
index 8f0ab5f..0c5aba1 100644
--- a/lib/event.mli
+++ b/lib/event.mli
@@ -1,5 +1,9 @@
+(** Barebones of event dispatching. Most users will have no reason to look here. *)
+
+(** Used internally when received an unknown event. Is caught and logged. *)
exception Invalid_event of string
+(** Event dispatch type wrapper. Used internally. *)
type t =
| HELLO of Yojson.Safe.json
| READY of Yojson.Safe.json
@@ -37,8 +41,11 @@ type t =
| VOICE_SERVER_UPDATE of Yojson.Safe.json
| WEBHOOKS_UPDATE of Yojson.Safe.json
+(** Used to convert an event string and payload into a t wrapper type. *)
val event_of_yojson : contents:Yojson.Safe.json -> string -> t
+(** Sends the event to the registered handler. *)
val dispatch : t -> unit
+(** Wrapper to other functions. This is called from the shards. *)
val handle_event : ev:string -> Yojson.Safe.json -> unit \ No newline at end of file