raxx v1.0.1 Raxx.Stack
A Raxx.Stack
is a list of Raxx.Middleware
s 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
.
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
state()
(opaque)
state()
state()
The internal state of the Raxx.Stack
.
Its structure shouldn't be relied on, it is subject to change without warning.
t()
t() :: {Raxx.Stack, state()}
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
get_middlewares(arg)
get_middlewares(t()) :: [Raxx.Middleware.t()]
get_middlewares(t()) :: [Raxx.Middleware.t()]
Returns the server contained in the stack.
get_server(arg)
get_server(t()) :: Raxx.Server.t()
get_server(t()) :: Raxx.Server.t()
Returns the server contained in the stack.
new(middlewares \\ [], server)
new([Raxx.Middleware.t()], Raxx.Server.t()) :: t()
new([Raxx.Middleware.t()], Raxx.Server.t()) :: t()
Creates a new stack from a list of middlewares and a server.
set_middlewares(arg, middlewares)
set_middlewares(t(), [Raxx.Middleware.t()]) :: t()
set_middlewares(t(), [Raxx.Middleware.t()]) :: t()
Replaces the middlewares in the stack.
set_server(arg, server)
set_server(t(), Raxx.Server.t()) :: t()
set_server(t(), Raxx.Server.t()) :: t()
Replaces the server in the stack.