POE::F...dBlock(3pm)
β¨ NAME β¨
POE::Filter::RecordBlock β the little filter that translates between discrete records and blocks of them π
It's giving matchmaker, honestly: records on one side, blocks on the other, and this module does the introductions π«Ά
π SYNOPSIS π
Hello, dear reader π okay so real talk first: this SYNOPSIS does not contain a fully functioning sample program, and that's not a skill issue on your end. Your humble documenter literally could not come up with a short, reasonable use case for this module π. Please contact the maintainer if this module is useful to you. Otherwise you may wake up one morning to discover that it has been deprecated ππ.
Here's the shape of it anyway, bestie:
$filter = new POE::Filter::RecordBlock( BlockSize => 4 );
$arrayref_of_arrayrefs = $filter->get($arrayref_of_raw_data);
$arrayref_of_raw_chunks = $filter->put($arrayref_of_arrayrefs);
$arrayref_of_raw_chunks = $filter->put($single_arrayref);
$arrayref_of_leftovers = $filter->get_pending;
$arrayref_of_leftovers = $filter->put_pending;
π DESCRIPTION π
On input, POE::Filter::RecordBlock translates a stream of discrete items into a "block" of them π§. The way it does that? It collects items until it has BlockSize of them, then returns the whole lot of them in an array reference. Iconic little hoarder behavior, ngl π¦β¨
On output, this module flattens array references π¦.
β οΈ Heads up: this module may be deprecated in the future. Please contact the maintainer if this module is useful to you π.
π PUBLIC FILTER METHODS π
In addition to the usual POE::Filter methods, POE::Filter::RecordBlock supports the following. Yes bestie, we're going down the list, all of it, no skimming π€
π new
new() takes at least one mandatory argument, BlockSize, which must be defined and greater than zero π―. new() also accepts a CheckPut Boolean parameter that indicates whether put() should check for the proper BlockSize before allowing data to be serialized.
π¨ UsingCheckPutis not recommended, because it enables a write buffer in the filter, therefore breakingput()for normal use. Like, it's not a vibe. Don't do it π.
π put_pending
put_pending() returns an arrayref of any records that are waiting to be sent π¬. It is the outbound equivalent of POE::Filter's get_pending() accessor.
But listen: put_pending() is not part of the canonical POE::Filter API, so nothing will use it π. It's up to applications to handle pending output, whenever it's appropriate to do so. She's self-employed, essentially πβοΈ.
π blocksize
blocksize() is an accessor/mutator for POE::Filter::RecordBlock's BlockSize value. Get it, set it, main character energy π.
π checkput
checkput() is an accessor/mutator for POE::Filter::RecordBlock's CheckPut flag. (Remember the warning above, bestie π«Ά.)
π SEE ALSO π
POE::Filterβ for more information about filters in general π§POE::Filter::Stackableβ for more details on stacking filters π₯β¨
π BUGS π
- This filter may maintain an output buffer that no other part of POE will know about π³ secret buffer, no cap.
- This filter implements a highly specialized and seemingly not generally useful feature π.
- Does anyone use this filter? This filter may be deprecated if nobody speaks up π’π.
π AUTHORS & COPYRIGHTS π
The RecordBlock filter was contributed by Dieter Pearcey π«Ά. Documentation is provided by Rocco Caputo βοΈ.
Please see the POE manpage for more information about authors and contributors πΈ.
okay that's the whole page bestie, you ate it π
β¨ This one's from perl v5.34.0, dated 2022-03-25, and it's part of the User Contributed Perl Documentation β so go forth, translate your records into blocks, and slay π¦ππ
π¦ where this page comes from
- debian bookworm: libpoe-perl 2:1.3700-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libpoe-perl 2:1.3700-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libpoe-perl 2:1.3700-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libpoe-perl 2:1.3700-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms