package atacama

  1. Overview
  2. Docs

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 ('state, 'error) handler_result =
  1. | Ok
  2. | Continue of 'state
  3. | Continue_with_timeout of 'state * Riot.Net.Socket.timeout
  4. | Close of 'state
  5. | Error of 'state * 'error
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.

type 's t = (module Intf with type state = 's)
OCaml

Innovation. Community. Security.