View Source Babel.Pipeline (Babel v1.2.0)
Represents a sequence of Babel.Step
s (or nested Babel.Pipeline
s) that get
evaluated sequentially, when a step fails the pipeline stops and - if set -
invokes the on_error
handler in an attempt to recover from the error.
Pipelines can be chained together (using chain/2
). Babel will try to simplify
pipeline chains by merging pipelines without distinct names and no error handling.
Summary
Types
A term describing what this pipeline does
Functions
Combines a Babel.Pipeline
either with another Babel.Pipeline
or a list of
steps. Passing another Babel.Pipeline
might lead both pipelines being merged
into one larger Babel.Pipeline
.
Types
@type name() :: Babel.name()
A term describing what this pipeline does
@type on_error(output) :: (Babel.Error.t() -> Babel.Step.result_or_trace(output))
@type step() :: Babel.Applicable.t()
Functions
@spec apply(t(input, output), Babel.Context.t(input)) :: Babel.Trace.t(output) when input: any(), output: any()
@spec chain(t(input, in_between), t(in_between, output)) :: t(input, output) when input: any(), in_between: any(), output: any()
@spec chain(t(), [step()]) :: t()
@spec chain(t(), step()) :: t()
Combines a Babel.Pipeline
either with another Babel.Pipeline
or a list of
steps. Passing another Babel.Pipeline
might lead both pipelines being merged
into one larger Babel.Pipeline
.
Merging
When all of the following conditions match two Babel.Pipeline
s get merged:
- at least one pipeline has no
name
or bothname
s are equal - at least one pipeline has no
on_error
handler
In all other cases the second Babel.Pipeline
will be included as a step of
the first Babel.Pipeline
.