Does anyone know of a package providing Unix System V-style stream modules? I seek just the ability to plug stream modules together and have them process messages (and not an interface to any OS-supplied streams API). Bare-bones functionality like put / input_queue / work_method / successor would be fine.

Having found nothing on CPAN or elsewhere, I have written a little package for my own use. Now I am considering modularizing and posting it and would like to re-check for existing work.

Update: While looking for something completely different (state machines), I found POE. As it turns out, the design of POE::Filter has strong similarities to System V Stream Modules. However, there is at least one significant difference.

Some similarities: Both excel in processing layered protocols (cleanly separating the layers' concerns). This is no wonder because they were both designed for this purpose. A Filter may be compared to a Stream Module. Both perform a well-defined operation on the input, typically translation from one protocol (data format) to another. Both use a form of buffering. Both have simple get / put APIs. Both are typically used in a stacked (chained) configuration.

The difference: Filter operations are usually used as functions (called in a functional way). For example, a Filter's put method immediately returns the processed result(s). The Stream put method on the other hand 'feels' asynchronous. It is used solely for its side-effect(s). Depending on the details, it may return immediately, it does not return the result of the processing (with C, it would return void or an error code).

Maybe POE::Wheel is akin to Streams. It says on the man page: It would be nice if wheels were more like proper Unix streams. Still reading here.

Yes, I've seen that Filters also have other, somewhat asynchronous API functions, for example get_one_start(). Maybe Filters can be wrapped as Modules... maybe this is what Wheel does... wandering off mumbling...


In reply to Existing System V-style streams package? by flachschippe

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.