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() Promise

Added in version 1.14.

classmethod new_with_change_func(func: Callable[[...], None], *user_data: Any) Promise

func will be called exactly once when transitioning out of PENDING into any of the other PromiseResult states.

Added in version 1.14.

Parameters:
  • func – a PromiseChangeFunc to call

  • user_data – argument to call func with

Methods

class Promise
expire() None

Expire a promise. This will wake up any waiters with EXPIRED. 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 in REPLIED and the returned structure is owned by promise

Added in version 1.14.

interrupt() None

Interrupt waiting for a promise. This will wake up any waiters with INTERRUPTED. 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 with REPLIED. 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 the PENDING state. If promise is not in PENDING then it will return immediately with the current result.

Added in version 1.14.

Fields

class Promise
parent

Parent MiniObject