Data::...:Stream(3pm)

✨ NAME ✨

Data::MessagePack::Stream β€” yet another messagepack streaming deserializer πŸ¦‹ (fr fr, that's literally what it is, bestie, and yes, the man page header truncates it down to Data::...:Stream because man pages are dramatic like that πŸ’…)


🌸 SYNOPSIS 🌸

use Data::Dumper;
my $unpacker = Data::MessagePack::Stream->new;

while (read($fh, my $buf, 1024)) {
    $unpacker->feed($buf);

    while ($unpacker->next) {
        print Dumper($unpacker->data);
    }
}

okay so that's the whole vibe right there: make an unpacker, feed it bytes as they show up, and every time next says "yes queen" you grab the data πŸŽ€


πŸ’– DESCRIPTION πŸ’–

Data::MessagePack::Stream is a streaming deserializer for MessagePack. periodt.

She's the alternate for Data::MessagePack::Unpacker β€” like, the cooler sibling who actually has her life together πŸ™‚β€β†•οΈ. Unlike the original unpacker, this module supports an internal buffer, which means it's possible to handle streaming data correctly β€” no half-parsed packets sliding in and ruining the whole moment πŸ’€.


πŸ‘‘ METHODS πŸ‘‘

🧚 new

my $unpacker = Data::MessagePack::Stream->new;

Create new stream unpacker. That's it, that's the whole thing, she's born ✨

πŸ“ feed($data)

$unpacker->feed($data);

Push $data into unpacker's internal buffer. Think of it like handing her more snacks for later β€” she'll nibble when she's ready 🫢

🌈 next

my $bool = $unpacker->next;

If parsable MessagePack packet is fed, return true. You can get that parsed data by "data" method described below. lowkey the most main character method in the whole file ngl ⭐

πŸ’œ data

my $data = $unpacker->data;

Return parsed perl object. That's the payoff, bestie, that's the moment πŸŽ€


🌸 AUTHOR 🌸

Daisuke Murase <typester@cpan.org> β€” iconic behavior, we love to see it πŸ‘‘


Copyright (c) 2012 by KAYAC Inc.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.


okay that's the whole page, bestie β€” and per the footer that has been living down there this entire time: it's perl v5.42.3, dated 2026-08-21, and it's filed under the manual page name Data::...:Stream(3pm) (yes, still truncated, no, I don't make the rules πŸ™ˆ). go forth and stream responsibly πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from