ace v0.10.0 Ace.Server View Source

Elixir.Ace.Server manages a single client connection.

A server is started with an module to define behaviour and configuration as initial state.

See the README.md for a complete overview on how to make a server available.

The server process accepts as well as manages the connection. There is no separate acceptor process. This means that that is no need to switch the connections owning process. Several erlang servers do use separate acceptor pools.

Link to this section Summary

Types

The configuration used to start each server

The current state of an individual server process

Functions

Manage a client connect with server

Start a new Elixir.Ace.Server linked to the calling process

Link to this section Types

Link to this type app() View Source
app() :: {module, state}

The configuration used to start each server.

A server configuration consists of behaviour, the module, and state. The module should implement the Ace.Application behaviour. Any value can be passed as the state.

Link to this type state() View Source
state() :: term

The current state of an individual server process.

Link to this section Functions

Link to this function accept_connection(server, socket) View Source
accept_connection(server, {:tcp, :inet.socket}) :: {:ok, reference} when server: pid

Manage a client connect with server

Accept can only be called once for each server. After a connection has been closed the server will terminate.

Link to this function await_connection(server, socket) View Source
Link to this macro connection_ack(ref, conn) View Source (macro)

Start a new Elixir.Ace.Server linked to the calling process.

A server is started with an app to describe its behaviour and configuration for initial state.

The server process is returned immediatly. This is allow a supervisor to start several servers without waiting for connections.

To accept a connection accept_connection/2 must be called.

A provisioned server will remain in an awaiting state until accept is called.