CI

ExPipeline

An opinionated library to build better pipelines.

Creating a Pipeline

On the module that will implement the pipeline, simplye use Pipeline and you are ready to go.

An example:

defmodule MyModule do
use Pipeline
@doc """
First step of the pipeline
"""
def init_step(value, options) do
# {:ok, updated_value}
# or
# {:error, some_error}
end
@doc """
Second step of the pipeline
"""
def second_step(value, options) do
# {:ok, updated_value}
# or
# {:error, some_error}
end
@doc """
Callback - always executed, results ignored
"""
def report_callback(state, _options) do
MyReportingModule.publish(state)
end
end

With this module in place, you have two options to execute it:

Both lines will execute the pipeline:

MyModule.execute(starting_value, options)
Pipeline.execute(MyModule, starting_value, options)

Installation

If available in Hex, the package can be installed by adding ex_pipeline to your list of dependencies in mix.exs:

def deps do
[
{:ex_pipeline, "~> 0.1.0"}
]
end