---
name: "Promise::XS::Deferred"
section: "3pm"
platform: "linux"
package: "libpromise-xs-perl"
version: "0.20-1+b4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Promise::XS::Deferred"
---

# Promise::XS::Deferred(3pm)

deferred object

## NAME

Promise::XS::Deferred - deferred object

## SYNOPSIS

See Promise::XS.

## DESCRIPTION

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

## 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.

## 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.)
