Pipex v0.1.0 Pipex View Source
Use:
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