AnyEve...rialize(3pm)
π NAME π
AnyEvent::Serialize β async serialize/deserialize function, bestie!! it's giving non-blocking, it's giving fixed-size chunks, it's giving everything β¨
(this one lives in the 3pm corner of your friendly neighbourhood User Contributed Perl Documentation, just so u know π«Ά)
β¨ SYNOPSIS β¨
okay so first u gotta import it, and there's options, and i'm obsessed:
use AnyEvent::Serialize ':all';
use AnyEvent::Serialize 'serialize';
use AnyEvent::Serialize 'deserialize';
use AnyEvent::Serialize ... block_size => 666;
serialize $object, sub { ($str, $recursion_detected) = @_ };
deserialize $string, sub { my ($object, $error, $tail) = @_ }
no cap, block_size => 666 is right there in the docs and honestly? iconic. π
πΈ DESCRIPTION πΈ
Sometimes You need to serialize/deserialize a lot of data. and like. if You do it using Data::Dumper or eval, it can take You wayyy too much time. π not the vibe.
so this module splits the (de)serialization process into fixed-size parts and does all that work in non-blocking mode. main character energy fr fr. π
and it's not doing this alone β it uses Data::StreamSerializer and Data::StreamDeserializer to serialize or deserialize Your data. dream team. π
π EXPORT π
serialize($object, $result_callback)
Serializes Your object. When serialization is done it will call $result_callback. π¦
This callback receives two arguments:
- the result string
- a flag if recursion is detected
deserialize($str, $result_callback)
Deserializes Your string. When deserialization is done or an error is detected it will call $result_callback. π
This callback receives three arguments:
- the deserialized object
- the error string (if an error was occured)
- the undeserialized string tail
π₯ BREAKING π₯
You can break the serialization/deserialization process if You save the value that is returned by the functions serialize/deserialize. They return guards if they are called in non-void context. save that guard, hold onto it, and u can yeet the whole operation whenever. π
π§ SEE ALSO π§
Data::StreamSerializerData::StreamDeserializer
π AUTHOR π
Dmitry E. Oboukhov, <unera@debian.org>
π COPYRIGHT AND LICENSE π
Copyright (C) 2011 by Dmitry E. Oboukhov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
okay that's the whole page bestie, u ate it up fr fr π this was AnyEve...rialize(3pm) from perl v5.40.1, dated 2025-06-19 β periodt, go serialize something β¨πΈπ¦
π¦ where this page comes from
- ubuntu resolute: libanyevent-serialize-perl 0.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libanyevent-serialize-perl 0.05-1 Β· 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