AnyEve...rialize(3pm)

πŸ“¦
version 0.05 Β· 3 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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::StreamSerializer
  • Data::StreamDeserializer

πŸ’œ AUTHOR πŸ’œ

Dmitry E. Oboukhov, <unera@debian.org>


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