[Xcb] [PATCH 2/3] Do not block when calling reply() multiple times.

Julien Danjou julien at danjou.info
Sat Jan 23 02:47:45 PST 2010


At 1264242958 time_t, Eamon Walsh wrote:
> The proper solution here is to add some notation to the XML to indicate
> when a request has multiple replies.  This can be passed through to the
> generated Python and then the behavior can be tailored to the type of
> reply: "single" replies can be cached as the patch does it and the
> behavior for multiple replies can remain as it is now, try to fetch a
> new reply on each call.

Sounds like a good idea.

> This still leaves open the question of what happens in a multiple-reply
> scenario if the Cookie object is freed and more replies arrive afterwards.

Well, I think we can assume and document that it's safe[1] to not call
.reply() on a SingleReplyRequest, but not on a MultipleReplyRequest.

By the way we probably miss a xcb.Reply.poll() method to check whetever
a reply is available. That would help to do things like:

recording_cookie = send_some_record_request()
recording_cookie.reply() # Get some replies
recording_cookie.reply() # Get some replies
recording_cookie.reply() # Get some replies
send_some_stop_record_request()
while recording_cookie.poll(): pass # eat all replies left

(according that's how the record extension work, but reading the .xml it
seems to be something like that with EnableContext and DisableContext)

[1] Well, will be with my patch #3 :)

-- 
Julien Danjou
// ᐰ <julien at danjou.info>   http://julien.danjou.info
// Trust me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20100123/031e0e7f/attachment.pgp 


More information about the Xcb mailing list