Package tech.illuin.pipeline
Interface Pipeline<I>
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
CompositePipeline
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The Pipeline interface is both the top-level type for Pipeline implementations, and the entrypoint for the creation of pipeline builders via the
of(java.lang.String)
methods.- Author:
- Pierre Lecerf ([email protected])
-
Method Summary
Modifier and TypeMethodDescriptionasStep()
Returns aStep
wrapping the execution of this Pipeline instance.default void
close()
default String
id()
The returned identifier should ideally be unique throughout an application.default Context
default Context
newContext
(Output parent) static <I> SimplePipelineBuilder<I>
Returns a newSimplePipelineBuilder
instance for assembling a Pipeline which abstracts away payload management.static <I> PayloadPipelineBuilder<I>
of
(String id, InitializerAssembler<I> initializer) static <I> PayloadPipelineBuilder<I>
of
(String id, Initializer<I> initializer) Returns a newPayloadPipelineBuilder
instance, this is the default type of pipeline with input and payload management.default Output
run()
Runs the Pipeline with a null input and an emptySimpleContext
.default Output
Runs the Pipeline with an emptySimpleContext
.default Output
Runs the Pipeline with aSimpleContext
that can be adjusted via the setup argument.The run method is the Pipeline's sole entrypoint, responsible for implementing its behaviour.
-
Method Details
-
id
The returned identifier should ideally be unique throughout an application. It is used in log entries and by thePipelineContainer
as an identity and indexing key.- Returns:
- the Pipeline's identifier
-
run
The run method is the Pipeline's sole entrypoint, responsible for implementing its behaviour. It returns anOutput
which is the composition ofResult
instances produced during the run itself, as well as eventual historicalResult
retrieved from theContext
at initialization.- Parameters:
input
- an input value which can be directly processed byStep
or can contribute to the initialization of a payloadcontext
- an optionalContext
instance providing information related tu current and eventual previous runs- Returns:
- the Pipeline's output
- Throws:
PipelineException
-
run
Runs the Pipeline with aSimpleContext
that can be adjusted via the setup argument.- Throws:
PipelineException
- See Also:
-
run
Runs the Pipeline with a null input and an emptySimpleContext
.- Throws:
PipelineException
- See Also:
-
run
Runs the Pipeline with an emptySimpleContext
.- Throws:
PipelineException
- See Also:
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
asStep
- See Also:
-
asStep
Returns aStep
wrapping the execution of this Pipeline instance. The wrapper is responsible for managing context continuity, making it possible for the pipeline to access upstream results. -
of
Returns a newSimplePipelineBuilder
instance for assembling a Pipeline which abstracts away payload management.- Type Parameters:
I
- the Pipeline's input type- Parameters:
id
- the Pipeline's identifier- Returns:
- the builder instance
-
of
Returns a newPayloadPipelineBuilder
instance, this is the default type of pipeline with input and payload management.- Type Parameters:
I
- the Pipeline's input type- Parameters:
id
- the Pipeline's identifierinitializer
- the Initializer responsible for creating the payload- Returns:
- the builder instance
- See Also:
-
of
- See Also:
-
newContext
-
newContext
-