Promise
Added in version 1.14.
- class Promise(**kwargs)
- Constructors:
Promise()
new() -> Gst.Promise
new_with_change_func(func:Gst.PromiseChangeFunc, user_data=None) -> Gst.Promise
Constructors
- class Promise
-
- classmethod new_with_change_func(func: Callable[[...], None], *user_data: Any) Promise
func
will be called exactly once when transitioning out ofPENDING
into any of the otherPromiseResult
states.Added in version 1.14.
- Parameters:
func – a
PromiseChangeFunc
to calluser_data – argument to call
func
with
Methods
- class Promise
- expire() None
Expire a
promise
. This will wake up any waiters withEXPIRED
. Called by a message loop when the parent message is handled and/or destroyed (possibly unanswered).Added in version 1.14.
- get_reply() Structure | None
Retrieve the reply set on
promise
.promise
must be inREPLIED
and the returned structure is owned bypromise
Added in version 1.14.
- interrupt() None
Interrupt waiting for a
promise
. This will wake up any waiters withINTERRUPTED
. Called when the consumer does not want the value produced anymore.Added in version 1.14.
- reply(s: Structure | None = None) None
Set a reply on
promise
. This will wake up any waiters withREPLIED
. Called by the producer of the value to indicate success (or failure).If
promise
has already been interrupted by the consumer, then this reply is not visible to the consumer.Added in version 1.14.
- Parameters:
s – a
Structure
with the the reply contents
- wait() PromiseResult
Wait for
promise
to move out of thePENDING
state. Ifpromise
is not inPENDING
then it will return immediately with the current result.Added in version 1.14.
Fields
- class Promise
- parent
Parent
MiniObject