raxx v1.1.0 Raxx.Stack

A Raxx.Stack is a list of Raxx.Middlewares attached to a Raxx.Server. It implements the Raxx.Server interface itself so it can be used anywhere "normal" server can be.

Link to this section Summary

Types

The internal state of the Raxx.Stack.

t()

Represents a pipeline of middlewares attached to a server.

Functions

Returns the server contained in the stack.

Returns the server contained in the stack.

Creates a new stack from a list of middlewares and a server.

Replaces the middlewares in the stack.

Replaces the server in the stack.

Link to this section Types

Link to this opaque

state()

(opaque)
state()

The internal state of the Raxx.Stack.

Its structure shouldn't be relied on, it is subject to change without warning.

Link to this type

t()

t() :: {Raxx.Stack, state()}

Represents a pipeline of middlewares attached to a server.

Can be used exactly as any Raxx.Server.t/0 could be.

Link to this section Functions

Link to this function

get_middlewares(arg)

get_middlewares(t()) :: [Raxx.Middleware.t()]

Returns the server contained in the stack.

Link to this function

get_server(arg)

get_server(t()) :: Raxx.Server.t()

Returns the server contained in the stack.

Link to this function

new(middlewares \\ [], server)

new([Raxx.Middleware.t()], Raxx.Server.t()) :: t()

Creates a new stack from a list of middlewares and a server.

Link to this function

set_middlewares(arg, middlewares)

set_middlewares(t(), [Raxx.Middleware.t()]) :: t()

Replaces the middlewares in the stack.

Link to this function

set_server(arg, server)

set_server(t(), Raxx.Server.t()) :: t()

Replaces the server in the stack.