Skip to content

Latest commit

 

History

History
181 lines (93 loc) · 4.45 KB

elli.md

File metadata and controls

181 lines (93 loc) · 4.45 KB

Module elli

Elli acceptor manager.

Behaviours: gen_server.

Description

This gen_server owns the listen socket and manages the processes accepting on that socket. When a process waiting for accept gets a request, it notifies this gen_server so we can start up another acceptor.

Data Types

abstract datatype: body()

A binary or iolist.


header() = {Key::binary(), Value::binary() | string()}

headers() = [header()]

abstract datatype: http_method()

An uppercase atom representing a known HTTP verb or a binary for other verbs.

abstract datatype: req()

A record representing an HTTP request.


response_code() = 100..999

abstract datatype: state()

Internal state.

Function Index

get_acceptors/1
get_open_reqs/1Equivalent to get_open_reqs(S, 5000).
get_open_reqs/2
set_callback/3
start_link/0Create an Elli server process as part of a supervision tree, using the default configuration.
start_link/1
stop/1Stop Server.

Function Details

get_acceptors/1


get_acceptors(S::atom()) -> {reply, {ok, [ets:tid()]}, state()}

get_open_reqs/1


get_open_reqs(S::atom()) -> {reply, {ok, non_neg_integer()}, state()}

Equivalent to get_open_reqs(S, 5000).

get_open_reqs/2


get_open_reqs(S::atom(), Timeout::non_neg_integer()) -> Reply
  • Reply = {reply, {ok, non_neg_integer()}, state()}

set_callback/3


set_callback(S, Callback, CallbackArgs) -> Reply

start_link/0


start_link() -> Result
  • Result = {ok, Pid} | ignore | {error, Error}
  • Pid = pid()
  • Error = {already_started, Pid} | term()

Equivalent to start_link([{callback, elli_example_callback},{callback_args, []}]).

Create an Elli server process as part of a supervision tree, using the default configuration.

start_link/1


start_link(Opts) -> Result
  • Opts = [{term(), term()}]
  • Result = {ok, Pid} | ignore | {error, Error}
  • Pid = pid()
  • Error = {already_started, Pid} | term()

stop/1


stop(Server::atom()) -> {stop, normal, ok, state()}

Stop Server.