16 Oct 2021 00:48:58 UTC
- Distribution: Promise-XS
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Testers (320 / 0 / 0)
- KwaliteeBus factor: 1
- 62.57% Coverage
- License: perl_5
- Activity24 month
- Download (74.01KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:5 non-PAUSE usersFELIPE Felipe Gasperand 2 contributors
- Felipe Gasper (FELIPE)
- Tom van der Woerdt
- 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.)