A Pipe to the Future

Mathieu Suen mathk.sue at gmail.com
Thu Sep 6 00:26:42 UTC 2007


Hi,

On Sep 6, 2007, at 2:02 AM, Peter William Lount wrote:

> Hi,
>
> I am wondering if the following would be possible and if so how?
>
> aProcess := [ "a block that pumps out continuous values"] fork.
> bProcess := [:in | in someOperation ] fork.

#fork resume the process but you could use #newProcess instead.

I would rather think about something like this:

[ "a block that pumps out continuous values"]  | [:in | in  
someOperation ]

and you could add somethings like:

[ "a block that pumps out continuous values"]  > anoutPutStream
[:in | in someOperation ] < anInputStream


	Mth

>
> "pipe the results of process a into process b like in unix shell"
> aProcess asPipeInto: bProcess.
>
> or
>
> aProcess | bProcess
>
> Would a shared queue be needed? Or some other concurrency control  
> mechanism for sharing the output results.
>
> Unfortunately blocks don't pump out multiple values... or  
> fortunately they don't.

You could call #value several time unless there have a return  
statement (depending on special case...).

>
> Just a thought.
>
> Cheers,
>
> Peter
>
>
>




More information about the Squeak-dev mailing list