1Pipeline(3)           User Contributed Perl Documentation          Pipeline(3)
2
3
4

NAME

6       Pipeline - Generic pipeline interface
7

SYNOPSIS

9         use Pipeline;
10         my $pipeline = Pipeline->new();
11         $pipeline->add_segment( @segments );
12         $pipeline->dispatch();
13

DESCRIPTION

15       "Pipelines" are a mechanism to process data. They are designed to be
16       plugged together to make fairly complex operations act in a fairly
17       straightforward manner, cleanly, and simply.
18

USING THE PIPELINE MODULE

20       The usage of the generic pipeline module is fairly simple. You
21       instantiate a Pipeline object by using the new() constructor.
22
23       Segments can be added to the pipeline with the add_segment method.
24
25       The store that the Pipeline will use can be set by calling the store()
26       method later on.  If a store is not set by the time a pipeline is
27       executing then it will use a store of the type
28       "Pipeline::Store::Simple".
29
30       To start the pipeline running call the dispatch() method on your
31       Pipeline object.
32
33       If a segment returns a Pipeline::Production object then the pipeline
34       will be terminated early and the production will be returned to the
35       user.  Regardless of when the pipeline is terminated the pipeline's
36       cleanup pipeline is executed.  Segments can be added to the cleanup
37       pipeline either explicitly by calling the cleanups method to get the
38       cleanup pipeline and then adding the segment, or implicitly by
39       returning a segment object from a segment.
40
41       To see what is being dispatched within a pipeline dispatch set the
42       pipeline's debug_all value to true.
43
44   INHERITANCE
45       Pipelines are designed to be inherited from.  The inheritance tree is
46       somewhat warped and should look a little like this:
47
48            MySegment --> Pipeline::Segment <--- Pipeline
49
50       In other words, everything is a pipeline segment.
51

METHODS

53       The Pipeline class inherits from the "Pipeline::Segment" class and
54       therefore also has any additional methods that its superclass may have.
55
56       init( @_ )
57           Things to do at construction time.  If you do override this, it
58           will often be fairly important that you call and check the value of
59           $self->SUPER::init(@_) to make sure that the setup is done
60           correctly.  Returns itself on success, undef on failure.  The
61           constructor will fail if you return a false value.
62
63       add_segment( LIST )
64           Adds a segment or segments to the pipeline.  Returns itself.
65
66       get_segment( INTEGER )
67           Returns the segment located at the index specified by INTEGER
68
69       del_segment( INTEGER )
70           Deletes and returns the segment located at the index specified by
71           INTEGER
72
73       process_results( ARRAYREF )
74           Examines each result of a segment and calls process_indv_result
75           with each element of ARRAYREF.  In the case that
76           process_indv_result returns a production then it is returned to the
77           caller.
78
79       process_indv_result( SCALAR )
80           Examines a single result and does the appripriate thing with it
81           (ie, if it is an object it puts it into the store, if it is a
82           production it returns it to the caller, and if it is a simple value
83           it gets thrown away.  In the case that a value is returned from
84           process_indv_result the pipeline should terminate.
85
86       dispatch()
87           Starts the pipeline execution.  It calls process_results on
88           anything that a segment returns.  The pipeline always returns the
89           production or true.
90
91       dispatch_loop( Pipeline, [ ARRAYREF ] )
92           The "dispatch_loop" method performs the processing for the pipeline
93
94       start_dispatch
95           Prepares all elements of the pipeline to begin processing a
96           segment.
97
98       end_dispatch
99           Cleans up all elements of the pipeline after processing a segment.
100
101       dispatch_segment( Pipeline::Segment )
102           The "dispatch_segment" method handles the execution of an
103           individual segment object.
104
105       dispatcher( [Pipeline::Dispatch] )
106           The "dispatcher" method gets and sets the pipeline dispatcher
107           object that will be used to traverse the pipeline.
108
109       cleanups()
110           Returns the cleanup pipeline.  This is a pipeline in and of itself,
111           and all the methods you can call on a pipeline can also be called
112           on this.
113
114       cleanup()
115           Calls the dispatch method on the cleanup pipeline.
116
117       segments( [ value ] )
118           "segments" gets and sets the value of the pipeline list.  At
119           initialization this is set to an array reference.
120
121       debug_all( value )
122           Sets debug( value ) recursively for each segment in this pipeline.
123

SEE ALSO

125       "Pipeline::Segment", "Pipeline::Store", "Pipeline::Store::Simple"
126       "Pipeline::Production", "Pipeline::Dispatch"
127

AUTHORS

129         James A. Duncan <jduncan@fotango.com>
130         Leon Brocard <acme@astray.com>
131
133       Copyright 2003 Fotango Ltd.  Licensed under the same terms as Perl
134       itself.
135
136
137
138perl v5.34.0                      2022-01-21                       Pipeline(3)
Impressum