Dex.Promise
Description: Reference for Dex.Promise

### Class

# DexPromise

#### Description [src]

    final class Dex.Promise : GObject.TypeInstance
    {
      /* No available fields */
    }

`DexPromise` is a convenient `DexFuture` for propagating a result or rejection in application and library code.

Use this when there is not a more specialized `DexFuture` for your needs to propagate a result or rejection to the caller in an asynchronous fashion.

#### Hierarchy

#### Ancestors

- DexFuture
- DexObject

#### Constructors

###### dex_promise_new

Creates a new promise which may be completed or rejected using the available methods.

###### dex_promise_new_cancellable

Creates a new `DexPromise` that can propagate cancellation if the promise is discarded.

#### Instance methods

###### dex_promise_get_cancellable

Gets a `GCancellable` that will cancel when the promise has been discarded (and therefore result no longer necessary).

###### dex_promise_reject

Marks the promise as rejected, indicating a failure.

###### dex_promise_resolve

Sets the result for a `DexPromise`.

###### dex_promise_resolve_boolean

Resolve promise to `value`.

###### dex_promise_resolve_boxed

No description available.

since: 0.10

###### dex_promise_resolve_double

Resolve promise to `value`.

###### dex_promise_resolve_enum

Resolve `promise` to `value`.

unstable since: 1.2

###### dex_promise_resolve_fd

Resolves the promise to `fd`.

###### dex_promise_resolve_float

Resolve promise to `value`.

###### dex_promise_resolve_int

Resolve promise to `value`.

###### dex_promise_resolve_int64

Resolve promise to `value`.

###### dex_promise_resolve_long

Resolve promise to `value`.

###### dex_promise_resolve_object

No description available.

###### dex_promise_resolve_string

No description available.

###### dex_promise_resolve_uint

Resolve promise to `value`.

###### dex_promise_resolve_uint64

Resolve promise to `value`.

###### dex_promise_resolve_ulong

Resolve promise to `value`.

###### dex_promise_resolve_variant

If `variant` is floating, its reference is consumed.

since: 0.8

##### Methods inherited from DexFuture (25)

Please see DexFuture for a full list of methods.

##### Methods inherited from DexObject (2)

###### dex_ref

Acquires a reference on the given object, and increases its reference count by one.

###### dex_unref

Releases a reference on the given object, and decreases its reference count by one.