pipeline v0.1.0 Pipeline
Pipeline is a monad-based alternative to Plug’s builder and router. It offers much of the same functionality.
This module can be use
-d into a module in order to build a pipeline:
defmodule MyApp do
use Pipeline
def hello(conn, opts) do
Plug.Conn.send_resp(conn, 200, body)
end
def pipeline(options) do
empty
~> plug(Plug.Logger)
~> plug(:hello)
end
end
Summary
Functions
The “unit”. Mainly just useful for chaining off of so things don’t look weird.
You can do things like: empty ~> foo ~> bar
Handle some errors
Halt the pipeline
Basically a structural cond
or case
statement
Use a plug
The ~> operator
The ~>> operator
Functions
The “unit”. Mainly just useful for chaining off of so things don’t look weird.
You can do things like: empty ~> foo ~> bar
.