View Source Babel.Pipeline (Babel v1.2.0)
Represents a sequence of Babel.Steps (or nested Babel.Pipelines) 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.Pipelines get merged:
- at least one pipeline has no
nameor bothnames are equal - at least one pipeline has no
on_errorhandler
In all other cases the second Babel.Pipeline will be included as a step of
the first Babel.Pipeline.