[Bug 789843] API: GstPromise - object with promise/future-like semantics

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Nov 20 12:50:38 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=789843

Sebastian Dröge (slomo) <slomo at coaxion.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slomo at coaxion.net

--- Comment #11 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
(In reply to Matthew Waters (ystreet00) from comment #10)
> > ::: gst/gstpromise.h
> > @@ +36,3 @@
> > + * @GST_PROMISE_RESULT_INTERRUPTED: Interrupted by the consumer
> > + * @GST_PROMISE_RESULT_REPLIED: A producer marked a reply
> > + * @GST_PROMISE_RESULT_EXPIRED: The promise expired (the carrying object
> > lost all refs)
> > 
> > What's the carrying object? How do interrupted and expired differ,
> > interrupted is caused by the consumer of the promise and expired by the
> > producer?
> 
> e.g. sending a GstMessage, or on some other parent (or carrying) object
> where task-like semantics are enforced e.g. GstBus.  Expired means that that
> object has been destroyed and so the promise will never be fulfilled. 
> Interrupted means that the waiter doesn't want/need the value anymore.

Maybe a comment about that to the docs :)


> > @@ +45,3 @@
> > +  GST_PROMISE_RESULT_INTERRUPTED,
> > +  GST_PROMISE_RESULT_REPLIED,
> > +  GST_PROMISE_RESULT_EXPIRED,
> > 
> > It might be good to also add an ERROR case here, and allow to get/pass a
> > GError in that case. Everything can fail
> 
> I don't believe any of the promise functionality has the potential to fail
> without a warn/critical.  Did you have a specific case in mind where this is
> not the case?

Not the promise infrastructure, but an actual promise itself. It's similar to
expired, but with a real error. Constructed example: Say you promise to produce
some information that requires you to talk to the network, but then DNS
resolution fails and you can't provide that information anymore. What would
happen then? Ideally you'd like to tell the consumer that the promise is never
going to be fulfilled anymore and that there was this specific error.

Note also that the promises in GIO are all fallible (GAsyncResult / GTask).

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list