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.

🚨 Using CheckPut is not recommended, because it enables a write buffer in the filter, therefore breaking put() 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