Pipeline (Pipes and Filters Pattern)

Please post support and help requests here.
Posts: 8
Joined: 16 Jun 2009, 17:39

Pipeline (Pipes and Filters Pattern)

Postby marcusmonaghan » 16 Jun 2009, 18:06


I'm about to design and create a pipeline using POCO but I thought I'd make sure there wasn't a freely available version already available.

The basic idea at the moment is to create a Pipeline class that holds a set of tasks (PipelineTask : public Task). These tasks will use a NotificationQueue to obtain data and to send data onto the next task. So I'll end up with something like:

HeadTask -> NotificationQueue -> PipelineTask -> NotificationQueue -> PipelineTask -> NotificationQueue -> TailTask

HeadTask and TailTasks will simply act as passthrough tasks (they won't do anything) so that the Pipeline has a starting and ending points.

The usage would then be something like:

Code: Select all

Pipeline pl;
PipelineTask pt1;
PipelineTask pt2;
PipelineTask pt3;

pl.add( pt1 );
pl.add( pt2 );
pl.add( pt3 );

pl.start(); // Start the pipeline tasks in a threadpool ...

// Add some sort of pipeline notification to the pipeline ... this will make it's way through the pipeline
pl.enqueueNotification( new PipelineNotification() );

// Wake all of the tasks up and wait for them to end

// Send a special notification down the pipeline telling each task to stop ...
pl.enqueueStateNoticiation( PIPELINE_STOP );

If this works out I'll make the library publically available (obviously if it's good enough!).


Return to “Support”

Who is online

Users browsing this forum: No registered users and 4 guests