API Reference
thecodecrate_pipeline
Pipeline
Pipeline(
processor_class: Optional[
type[ProcessorInterface]
] = None,
processor_instance: Optional[ProcessorInterface] = None,
processor: Optional[
type[ProcessorInterface] | ProcessorInterface
] = None,
*args: Any,
**kwds: Any,
)
Pipeline Class
process
async
Process the given payload through the pipeline.
with_processor
with_processor(
processor: (
type[ProcessorInterface] | ProcessorInterface
),
) -> Self
Attachs a processor (class or instance) to the pipeline.
with_processor_class
with_processor_class(
processor_class: type[ProcessorInterface],
) -> Self
Attachs a processor class to the pipeline.
with_processor_instance
with_processor_instance(
processor_instance: ProcessorInterface,
) -> Self
Attachs a processor instance to the pipeline.
with_stages
with_stages(stages: StageCollection) -> Self
Adds a collection of stages to the pipeline.
PipelineFactory
PipelineFactory(
processor_class: Optional[
type[ProcessorInterface]
] = None,
processor_instance: Optional[ProcessorInterface] = None,
processor: Optional[
type[ProcessorInterface] | ProcessorInterface
] = None,
*args: Any,
**kwds: Any,
)
with_processor
with_processor(
processor: (
type[ProcessorInterface] | ProcessorInterface
),
) -> Self
Attachs a processor (class or instance) to the pipeline factory.
with_processor_class
with_processor_class(
processor_class: type[ProcessorInterface],
) -> Self
Attachs a processor class to the pipeline factory.
with_processor_instance
with_processor_instance(
processor_instance: ProcessorInterface,
) -> Self
Attachs a processor instance to the pipeline factory.
with_stages
with_stages(stages: StageCollection) -> Self
Adds a collection of stages to the pipeline.
PipelineFactoryInterface
PipelineFactoryInterface(
processor_class: Optional[
type[ProcessorInterface]
] = None,
processor_instance: Optional[ProcessorInterface] = None,
processor: Optional[
type[ProcessorInterface] | ProcessorInterface
] = None,
*args: Any,
**kwds: Any,
)
with_processor
with_processor(
processor: (
type[ProcessorInterface] | ProcessorInterface
),
) -> Self
PipelineInterface
PipelineInterface(
processor_class: Optional[
type[ProcessorInterface]
] = None,
processor_instance: Optional[ProcessorInterface] = None,
processor: Optional[
type[ProcessorInterface] | ProcessorInterface
] = None,
*args: Any,
**kwds: Any,
)
with_processor
with_processor(
processor: (
type[ProcessorInterface] | ProcessorInterface
),
) -> Self
Processor
Processor(*args: Any, **kwds: Any)
Processor Class
process
abstractmethod
async
Process the given payload through the provided stages.
Parameters:
-
payload
T_in
) –The input payload to process.
-
stages
StageInstanceCollection
) –The collection of stages to process the payload through.
-
*args
Any
, default:()
) –Additional positional arguments.
-
**kwds
Any
, default:{}
) –Additional keyword arguments.
Returns:
-
T_out
(T_out
) –The processed output.