Evd.Promise¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Evd.Promise(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- cancel()¶
Cancels the asynchronous operation represented by the promise by calling
Gio.Cancellable.cancel
() on theGio.Cancellable
associated with the promise, if it is notNone
.
- get_cancellable()¶
- Returns:
The
Gio.Cancellable
, orNone
- Return type:
Obtains the
Gio.Cancellable
object associated with the promise, which can beNone
. Normally, the cancellable is passed to the function that triggered the asynchronous operation represented by the promise.
- get_result_boolean()¶
-
Retrieves the result of the asynchronous operation represented by the promise if it is held as
bool
, otherwise returnsFalse
. It is an error to call this method before the promise has been resolved.
- get_result_pointer()¶
-
Retrieves the result of the asynchronous operation represented by the promise if it is held as a
object
, otherwise returnsNone
. 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:
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:
- Returns:
- Return type:
Tells whether an asynchronous operation failed, in which case
True
is returned and the resulting error copied into error. Otherwise returnsFalse
.It is an error to call this method before the promise has been resolved.
- then(callback, *user_data)¶
- Parameters:
callback (
Gio.AsyncReadyCallback
orNone
) – Function to call when the promise is resolveduser_data (
object
orNone
) – Application data to pass in callback
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.