res://addons/w4gd/rest-client/client_promise.gd

Inherits: RefCounted

Inherited By: res://addons/w4gd/rest-client/client_request.gd

A promise which can have a chain of callbacks that can be resolved asynchronously or blocking.

Description

Calling async or blocking will start resolving the promise asynchronously or blocking, respectively. All of the callbacks added via then will be called with the result.

Properties

Array

chain

Variant

result

Status

status

0

Methods

void

async ( )

void

blocking ( int poll_delay_usec )

void

sequence ( Array promises )

void

then ( Callable callable )


Enumerations

enum Status:

Status PENDING = 0

Status COMPLETED = 1

Status FAILED = 2


Property Descriptions

Array chain

The chain of callbacks.


Variant result

The result of the REST request.


Status status = 0

The promise status.


Method Descriptions

void async ( )

Starts an asynchronous HTTP request to fulfill the promise.


void blocking ( int poll_delay_usec )

Starts a blocking HTTP request to fulfill the promise.


void sequence ( Array promises )

Creates a new promise that will resolve the given array of promises in sequence.


void then ( Callable callable )

There is currently no description for this method.