Evd.Promise

g Evd.Promise Evd.Promise GObject.GInterface GObject.GInterface Gio.AsyncResult Gio.AsyncResult GObject.GInterface->Gio.AsyncResult GObject.Object GObject.Object GObject.Object->Evd.Promise Gio.AsyncResult->Evd.Promise

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.AsyncResult (4)

Structs:

GObject.ObjectClass (5)

cancel ()

get_cancellable ()

get_result_boolean ()

get_result_pointer ()

get_result_size ()

propagate_error ()

then (callback, *user_data)

Virtual Methods

Inherited:

GObject.Object (7), Gio.AsyncResult (3)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Evd.Promise(**kwargs)
Bases:

GObject.Object, Gio.AsyncResult

Abstract:

No

Structure:

Evd.PromiseClass

cancel()

Cancels the asynchronous operation represented by the promise by calling Gio.Cancellable.cancel() on the Gio.Cancellable associated with the promise, if it is not None.

get_cancellable()
Returns:

The Gio.Cancellable, or None

Return type:

Gio.Cancellable

Obtains the Gio.Cancellable object associated with the promise, which can be None. Normally, the cancellable is passed to the function that triggered the asynchronous operation represented by the promise.

get_result_boolean()
Returns:

The result of the operation as a bool, or False

Return type:

bool

Retrieves the result of the asynchronous operation represented by the promise if it is held as bool, otherwise returns False. It is an error to call this method before the promise has been resolved.

get_result_pointer()
Returns:

The result of the operation as a object, or None

Return type:

object or None

Retrieves the result of the asynchronous operation represented by the promise if it is held as a object, otherwise returns None. It is an error to call this method before the promise has been resolved.

get_result_size()
Returns:

The result of the operation as a gssize, or zero

Return type:

int

Retrieves the result of the asynchronous operation represented by the promise if it is held as gssize, otherwise returns zero. It is an error to call this method before the promise has been resolved.

propagate_error()
Raises:

GLib.Error

Returns:

True if an error was propagated, False otherwise

Return type:

bool

Tells whether an asynchronous operation failed, in which case True is returned and the resulting error copied into error. Otherwise returns False.

It is an error to call this method before the promise has been resolved.

then(callback, *user_data)
Parameters:

Adds a new listener function to the asynchronous operation represented by the promise. If the operation has not yet completed, callback will be called together with all the other listeners as soon as it completes, in the same order as the listeners were added. If the operation already completed, callback will be called immediately on the next turn of the event loop.