Starship.Reactor (Starship v0.0.1) View Source

The main request handler for the Starship Webserver.

When a message is passed to a Starship.Drive process, a Starship.Reactor process is spawned to handle the request.

Link to this section Summary

Types

The connection state of the port and socket.

Link to this section Types

Specs

connection_state() :: :close | :keepalive

The connection state of the port and socket.

If set to :close, then the socket and port will return a Connection: Close header and close.

If set to :keepalive, then the socket and port will return a Connection: Keep-Alive header and stay open.

Link to this section Functions

Link to this function

build_conn(end_of_headers, buf)

View Source

Specs

build_conn(non_neg_integer(), binary()) ::
  {:ok, Starship.Reactor.Conn.t(), binary()} | {:error, Exception.t()}
Link to this function

get_host_handler(type, host, path, config_hosts)

View Source

Specs

get_host_handler(atom(), binary(), binary(), map()) :: {module(), map()}
Link to this function

handle_request(arg, buf, config)

View Source

Specs

handle_request({non_neg_integer(), non_neg_integer()}, binary(), map()) ::
  map() | true
Link to this function

header_too_large(config)

View Source

Specs

header_too_large(map()) :: true
Link to this function

http_version_not_supported(config)

View Source

Specs

http_version_not_supported(map()) :: true

Specs

loop(map()) :: map() | true
Link to this function

method_not_allowed(config)

View Source

Specs

method_not_allowed(map()) :: true

Specs

on_close(map()) :: true

Specs

on_tcp(map(), binary()) :: map() | true
Link to this function

on_ws_send(tuple, config)

View Source

Specs

on_ws_send(tuple(), map()) :: map()
Link to this function

process_request(conn, buf, config)

View Source

Specs

process_request(Starship.Reactor.Conn.t(), binary(), map()) :: map()

Specs