Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
An Atacama Handler determines how every connection handled by Atacama will behave. It defines a number of hooks for handling the state of the connection:
* `handle_close` – for when a connection is about to be closed
* `handle_connection` - to prepare the state of a connection right after it started.
* `handle_data` – to deal with data packets as they come. It is worth noting that Atacama does not determine how much to buffer, or how to read, and this is defined in the Transport module used.
* `handle_error` - to receive and handle any connection errors.
type t =
| H : {
handler : (module Handler.Intf
with type error = 'error
and type state = 'new_state);
state : 'new_state;
} -> t
type ('state, 'error) handler_result =
| Ok
| Continue of 'state
| Continue_with_timeout of 'state * Riot.Timeout.t
| Close of 'state
| Error of 'state * 'error
| Switch of t
module type Intf = sig ... end
The interface of an Atacama Handler. It is worth noting that you don't have to explicitly implement this interface, which allows your modules to include _more_ than is specified here.
module Default : sig ... end
Default handler methods. Useful for bootstrapping new handlers incrementally.