Pipeline - Generic pipeline interface
use Pipeline; my $pipeline = Pipeline->new(); $pipeline->add_segment( @segments ); $pipeline->dispatch();
Pipelines are a mechanism to process data. They are designed to
be plugged together to make fairly complex operations act in a
fairly straightforward manner, cleanly, and simply.
The usage of the generic pipeline module is fairly simple. You instantiate a Pipeline object by using the new() constructor.
Segments can be added to the pipeline with the add_segment method.
The store that the Pipeline will use can be set by calling the
store() method later on. If a store is not set by the time
a pipeline is executing then it will use a store of the type
To start the pipeline running call the dispatch() method on your Pipeline object.
If a segment returns a Pipeline::Production object then the pipeline will be terminated early and the production will be returned to the user. Regardless of when the pipeline is terminated the pipeline's cleanup pipeline is executed. Segments can be added to the cleanup pipeline either explicitly by calling the cleanups method to get the cleanup pipeline and then adding the segment, or implicitly by returning a segment object from a segment.
To see what is being dispatched within a pipeline dispatch set the pipeline's debug_all value to true.
Pipelines are designed to be inherited from. The inheritance tree is somewhat warped and should look a little like this:
MySegment --> Pipeline::Segment <--- Pipeline
In other words, everything is a pipeline segment.
The Pipeline class inherits from the
Pipeline::Segment class and
therefore also has any additional methods that its superclass may have.
dispatch_loopmethod performs the processing for the pipeline
dispatch_segmentmethod handles the execution of an individual segment object.
dispatchermethod gets and sets the pipeline dispatcher object that will be used to traverse the pipeline.
segmentsgets and sets the value of the pipeline list. At initialization this is set to an array reference.
James A. Duncan <email@example.com> Leon Brocard <firstname.lastname@example.org>
Copyright 2003 Fotango Ltd. Licensed under the same terms as Perl itself.