Mir

Code review comment for lp:~vanvugt/mir/wait-result

Revision history for this message
Chris Halse Rogers (raof) wrote :

You can't completely abolish callbacks without making asynchronously waiting on a result painful, but, yes, I do like the continuation/AsyncContext wait API I proposed (and that Windows¹ and GLib² use, among others) for our asynchronous API some years ago :).

I don't see how this is a step in that direction, though, and I think the specific uses in this MP make the API harder to use - in the case of waiting for a construction it's a duplication of foo_is_valid() without the ability to query the error condition, and in the case of waiting for set_foo() it's promoting an incorrect interaction with the client API.

I'm fully supportive of reworking our MirWaitHandle API to be less cumbersome, but that probably merits a ML discussion.

¹: Via ctx = FooBegin/result = FooEnd(ctx) pairs
²: Via GAsyncResult

review: Disapprove

« Back to merge proposal