Promis...romise(3pm)
π Promis...romise(3pm) π
okay bestie, so this one lives in the 3pm section of the perl manual (user-contributed perl docs, we love to see it), and yes the title is literally spelled Promis...romise β the man page name got ate, we don't ask questions, we just vibe π«Ά
β¨ NAME β¨
Promise::XS::Promise β it's a promise object, that's the whole thing π
β¨ SYNOPSIS β¨
ngl there's nothing here, it just points you at its bestie. Go see Promise::XS. π
β¨ DESCRIPTION β¨
So this right here? This is Promise::XS's actual promise object class β the real one, the main character, no understudies π
It implements these methods:
then()catch()finally()
β¦and they do exactly what you'd expect them to do, because they behave as they normally do in promise implementations. No plot twists, no surprises, just promise behaviour as promised π
Bonus round: on top of those, all() and race() are also usable. Like this:
my $p3 = Promise::XS::Promise->all( $p1, $p2, .. );
my $p3 = Promise::XS::Promise->race( $p1, $p2, .. );
β¦or, keeping it cute and class-flexible:
my $p3 = ref($p1)->all( $p1, $p2, .. );
my $p3 = ref($p1)->race( $p1, $p2, .. );
β¦or even just calling it straight off the object itself:
my $p3 = $p1->all( $p1, $p2, .. );
my $p3 = $p1->race( $p1, $p2, .. );
π¨ bestie, look closely at those last two examples:$p1shows up twice β once as the thing you're calling the method on, and again inside the argument list. That repetition is not a typo, it's just how it be. (The original man page literally parenthesises "Note the repetition of$p1in these last examples!" so like, it's important, iykyk π)
β¨ NOTES β¨
Okay so, bad news for the "what if I made my own fancy subclass" girlies: subclassing this class won't work π
Why? Because all the methods named above always return instances of (exactly) this class β not your subclass, not your custom flavour, just plain Promise::XS::Promise. Periodt.
That might change eventually, but for now, this is what's what. π€·βοΈ
and that's the whole page, bestie! no cap, no notes, we ate and left zero crumbs π
β¨ this was perl v5.42.3, dated 2026-08-22, signing off π¦π
π¦ where this page comes from
- ubuntu stonking: libpromise-xs-perl 0.21-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms