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 AND LICENSE π
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
- ubuntu stonking: libdata-messagepack-stream-perl 1.06+ds-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms