Data Source ->Pipe -----> Filter ----->Filter --------->DataSink
                            |                              ^
                            |                              |
                            |                              |
                            ->---------Filter--------------^

So in Perl list context gives the ability as with Unix pipes to pass from one filter to the next, but the list is completed before it goes on to the next stage, there is no concurrency, right? Even though it seems like there should be. Trying to find a good example:  map { $_^2 } grep { isPrime($_) } grep processes the whole list before map processes the first element? Why?

I guess the equivalent Perl5 is to create an iterator and threads and one thread pushes onto the queue and another one takes off the queue? So you have essentially a bucket brigade of threads. Each thread performs a filtering process and passes on to the next filter. So what is the approach to scale this idea so that each filter can be replaced / modified / added / deleted?

I found this paper: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3534.html And also the Perl6 Documentation (sorry) talks about concurrency - http://doc.perl6.org/language/concurrency as in the language itself supports this paradigm of programming with Promises and Supplies -- maybe. Is there some kind of equivalent feature in Perl 5? Maybe this: https://github.com/skaji/Process-Pipeline

Basically map and grep but acting in parallel, asynchronously, rather than in sequence.


In reply to Re^2: [OT] Software Architecture - Pipe and Filter by trippledubs
in thread [OT] Software Architecture - Pipe and Filter by trippledubs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.