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
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!).