[Bug 47322] [next] GCancellables for all async calls

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Mar 20 15:01:25 CET 2012


https://bugs.freedesktop.org/show_bug.cgi?id=47322

--- Comment #7 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-03-20 07:01:25 PDT ---
(In reply to comment #6)
> I it might not be all method, but at least all the DBus call, especially that
> it's free.

For APIs that make more than one method call behind the scenes (like a
Telepathy ChannelRequest), you can cancel and it will actually work, but to do
that, you need to design your D-Bus API to allow for it, something like:

    method Start()
    signal MoreResults(...)
    method Stop()

Again, ChannelRequest, FileTransfer and ContactSearch can do this, and perhaps
so can telepathy-logger (I haven't reviewed its API). For these APIs, sure, the
async op should be cancellable.

Most of Telepathy can't do this, though, because its D-Bus calls are just send
method call / wait for reply. If the method-call message has already been sent
to the service, there's nothing you can do about it; its side-effects will
happen whether you still want them or not.

If the D-Bus method-call message is still in your outgoing queue, in principle
you could remove it from that queue. I'm not aware of any implementation that
actually lets you do that, though (neither libdbus nor GDBus has this).

GDBus claims that method call are cancellable, but if you cancel, all it does
is to make a best-effort attempt to pass G_IO_ERROR_CANCELLED to the callback
"soon". The method-call message is still sent, and still has its side-effects.
I think this is quite misleading, and potentially dangerous.

The current tp_proxy_pending_call_cancel() (which is effectively what the death
of a weak_object does) doesn't call your callback at all, but other than that,
behaves like GDBus. Again, I think this is misleading.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- 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 telepathy-bugs mailing list