Promise...nyEvent(3)
π Promises::Deferred::AnyEvent π
okay so bestie, welcome to Promises::Deferred::AnyEvent, a page straight out of the User Contributed Perl Documentation collection. it's giving "promises but make it async" and honestly? we're obsessed. π¦
β¨ NAME β¨
Promises::Deferred::AnyEvent β an implementation of Promises in Perl. yes that's the whole name, no notes, it ate. π
πΈ VERSION πΈ
version 1.05 β¨ (she's grown, she's thriving)
π SYNOPSIS π
use Promises backend => ['AnyEvent'], qw[ deferred collect ];
# ... everything else is the same
lowkey the "everything else is the same" is the most iconic line in the whole file. main character energy fr fr. π
π¦ DESCRIPTION π¦
okay so here's the tea β: the "Promise/A+" spec is very strongly opinionated about the fact that the callbacks you hand over to then should run asynchronously β meaning in the next turn of the event loop, not right this second like some impatient little gremlin. π and this module? this module is the one that makes that happen, by using the AnyEvent module to do the actual async-ing. she's the backbone. the behind-the-scenes queen. π
now here's the part where module authors need to chill: if you're writing a module, you should not be out here caring which event loop is gonna get used. that's not your business bestie, that's a runtime decision. just use the Promises module directly and let the universe handle it:
package MyClass;
use Promises qw(deferred collect);
see? no event loop opinions. so peaceful. so unbothered. π§
meanwhile, the end users of the module β the ones actually running the app β they get to pick the backend themselves at the start of the application, like they're choosing an outfit for the day:
use Promises -backend => ['AnyEvent'];
use MyClass;
and that's it, that's the whole vibe check. the user decides, the module doesn't have to know, everybody wins. π
π AUTHOR π
Stevan Little <stevan.little@iinteractive.com> β absolute legend, thank you for your service π«‘π
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2025, 2017, 2014, 2012 by Infinity Interactive, Inc. β¨
and it's free software β you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so go forth, remix, redistribute, slay. π πΈ
and that's the whole page bestie!! this doc came to you from perl v5.42.0, dated 2025-07-25, and it lives in the Promises...nyEvent(3) slot of your manual. mwah π take care of her, she's an icon. πβ¨π
π¦ where this page comes from
- fedora 43: perl-Promises 1.05-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms