pipeline v0.1.0 API Reference

Modules

Pipeline is a monad-based alternative to Plug’s builder and router. It offers much of the same functionality

Pretty much built off Plug’s adapter, but simpler and supports the static optimization mechanisms provided by pipeline

Convert a pipeline into an elixir AST

Run a pipeline with a given connection. This is the runtime equivalent of the pipeline compiler. It’s still performant, but compiled code is always faster. The interpreter has one advantage in that you can use monadic bind to change the pipeline based on the value of the connection which is otherwise not possible in compilation, because the connection is not available

Print out a pipeline

Test a pipeline

Alter pipelines. Basically just a free interpreter whose state is also a pipeline being built up using the transformed existing pipeline

Fuse together several component actions in sequence to a single function. e.g. Convert status(200) ~> body("Hello World.") ~> send() into a single plug(fn conn -> conn |> send_resp(200, "Hello World") end)

Insert debug logging statements between all parts of a pipeline

A transform that just returns the existing pipeline. This is mainly useful in that other transforms can extend this one and then only need to add effect handlers for the things they are interested in

Turn match([x ~> halt]) ~> match([y ~> halt]) into match([x ~> halt, y ~> halt])

Turn plug(SomePlug, options) into SomePlug.pipeline(options) for plugs which are pipelines. This is essentially an optimization pass resulting in less overhead

This module lets you take advantage of Plug’s static compilation mechanism from within Pipeline. When you have a module that invokes plug Pipeline this pre-compilation hook generates a private function within that module representing the invocation of that pipeline and then replaces the plug call with the generated private function

Just like Plug’s Router!