Legend:
Library
Module
Module type
Parameter
Class
Class type
Signature of the functors Eliom_notif.Make and Eliom_notif.Make_Simple.
S has two types of notifications (server_notif and client_notif) because we might need to serialise and deserialise the notification twice (in case of a multi-server set-up). Once for broadcasting it to other servers and once for transferring it to the client (after possibly transforming the message using information which is only locally available (see prepare below).
type identity
identity is the type of values used to differentiate one listener from another. Typically it will be a user, but it could also for instance be a chat window.
type key
key is the type of values designating a given resource.
type server_notif
server notification type; Can be different from client_notif.
type client_notif
client notification type; Can be different from server_notif.
Initialise the notification module for the current client. This function needs to be called before using most other functions of this module. It isn't called implicitly during module instantiation because it relies on identity data which might not be available yet.
val deinit : unit -> unit
Deinitialise/deactivate the notification module for the current client.
Call notify key n to send a notification n to all clients currently listening on data referenced by key.
If ~notfor is `Me, notification will not be sent to the tab currently doing the request (the one which caused the notification to happen). Note that if notify is called with ~notfor:`Me outside of a request it will fail. If it is `Id id it won't be sent to the destination defined by id.