- BASIC METHODS
- ADDITIONAL METHODS
This class implements a promise’s “producer” behavior. It is not to be instantiated directly, but rather via Promise::XS.
The following are what’s needed to implement normal promise workflows:
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.
resolve() but rejects the promise instead.
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.
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.)