[Gllug] Imposing a delay in a pipeline

James Courtier-Dutton james.dutton at gmail.com
Thu Apr 22 20:46:53 UTC 2010


On 13 April 2010 15:00, - Tethys <tethys at gmail.com> wrote:
> Does anyone know of a utility to impose a delay in a pipeline? I want to do:
>
>        process_a | delay -5 | process_b
>
> such that process_b receives data 5 seconds after it was emitted by
> process_a. Any suggestions?
>

What you need is a buffer.
So, you read from process_a and place it in the buffer, and timestamp
each entry in the buffer.
Then your process_b just reads items from the buffer based on the timestamp.
You can have multiple readers as well if you want different feeds and
different delays.
You can then have another process, that goes around cleaning up, i.e.
removes data in the buffer that is too old.

It might be worth looking into something called java spaces.
It is very good for very high volume of messages.

Kind Regards

James
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list