Promis...eferred(3pm)
π NAME π
Promise::XS::Deferred β it's the deferred object, bestie π
(also it's a 3pm page, so like, Perl module docs, iykyk β¨)
π¦ SYNOPSIS π¦
okay so lowkey the synopsis is just:
See Promise::XS.
that's it. that's the whole vibe. go look at Promise::XS, she's the main character here π
πΈ DESCRIPTION πΈ
so this class is the one that handles a promise's "producer" behavior β like, the part that actually makes the promise do stuff, not the part that sits around waiting for it π
do NOT instantiate this directly. fr fr. you don't new this one yourself, you get it via Promise::XS. that's the whole pipeline, no shortcuts β¨
π BASIC METHODS π
these are the ones you need for, like, normal promise workflows. the everyday slay π
$obj = OBJ->resolve( @ARGUMENTS )β resolves OBJ's promise and hands it the given@ARGUMENTSas the value. returnsOBJπ«Ά
β οΈ IMPORTANT: behavior is not defined if literally anything in @ARGUMENTS is itself a promise. so like, don't do that. that's undefined behavior territory and we do not go there π
$obj = OBJ->reject( @ARGUMENTS )β same energy asresolve()but it rejects the promise instead. one of these days, am I right π
π ADDITIONAL METHODS π
the bonus round, the extra sprinkles π
$yn = OBJ->is_pending()β returns a boolean telling you whether the promise is still pending (as opposed to resolved or rejected). like, is she still cooking or is dinner served π³
normally you don't need this but it can be useful when you're debugging. it's giving detective energy π
and for compatibility with preexisting promise libraries, is_in_progress() exists as an alias for this exact same logic. two names, one girl. periodt π
$obj = OBJ->clear_unhandled_rejection()β so ordinarily, if a promise's rejection is "unhandled", a warning about that unhandled rejection gets produced. call this afterreject()to silence that warning π
(it's generally better, of course, to just handle all your errors. the warning is not the problem bestie, the unhandled rejection is π)
and that's the whole page!! this was perl v5.42.3, dated 2026-08-22, from the Promis...eferred(3pm) page (yes the title gets truncated in the header, we don't talk about it π). mwah, go resolve some promises responsibly πβ¨π¦
π¦ 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