logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Promise::XS::Deferred - deferred object

Additional Methods

$yn=OBJ->is_pending()
       Returns a boolean that indicates whether the promise is still pending (as opposed to resolved or
       rejected).

       This shouldn’t normally be necessary but can be useful in debugging.

       For compatibility with preexisting promise libraries, is_in_progress() exists as an alias for this logic.

   $obj=OBJ->clear_unhandled_rejection()
       Ordinarily, if a promise’s rejection is “unhandled”, a warning about the unhandled rejection is produced.
       Call this after reject() to silence that warning. (It’s generally better, of course, to handle all
       errors.)

perl v5.40.0                                       2024-10-20                         Promise::XS::Deferred(3pm)

Basic Methods

       The following are what’s needed to implement normal promise workflows:

   $obj=OBJ->resolve(@ARGUMENTS)
       Resolves OBJ’s promise, assigning the given @ARGUMENTS as the value.  Returns OBJ.

       IMPORTANT: Behavior here is not defined if anything in @ARGUMENTS is itself a promise.

   $obj=OBJ->reject(@ARGUMENTS)
       Like resolve() but rejects the promise instead.

Description

       This class implements a promise’s “producer” behavior. It is not to be instantiated directly, but rather
       via Promise::XS.

Name

       Promise::XS::Deferred - deferred object

Synopsis

       See Promise::XS.

See Also