Pipex v0.1.1 Pipex View Source

Example usage:

defmodule Pipeline do
  use Pipex

  alias __MODULE__

  defstruct var1: nil,
            var2: []

  pipe :local_function
  pipe ExternalModule

  def run(args) do
    token = struct(Pipeline, args)

    Pipeline.call(token)
  end

  def local_function(%Pipeline{} = token) do
    # do something with the token and return it
    %{token | va1: "var1"}
  end
end

def ExternalModule do
  def call(%Pipeline{} = token) do
    # do something with the token and return it
    %{token | var2: [1, 2, 3]}
  end
end

Link to this section Summary

Link to this section Functions

Link to this function call_pipes(module, initial_token, pipes) View Source