Re: non-blocking dbus server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/10/2009 03:23 PM, Mat Booth wrote:
On Fri, Jul 10, 2009 at 10:18 AM, Jiri Moskovcak<jmoskovc@xxxxxxxxxx>  wrote:
Hi,
in our project ABRT we use DBUS for communication between ABRT daemon and
client (gui), the problem is that when I ask daemon to do some
time-consuming work the server is blocked until the work is done. So I want
to use threads and that's where I found the catch.

Here is my idea:
1. client calls remote method foo() over dbus
2. daemon receives the call, creates the thread and let it do the work in
background and serve other requests
3. when the work is finished send reply to the client
- this is the part where I'm stuck, because I want to send the reply as
return message to the matching method call, but the method call already
returned when I started the thread. (So far I can achieve this by sending
signal with return value as an argument, but I don't think this is a good
solution).

I use dbus-c++, so maybe the answer is in some low-level DBUS API.

Thanks for any help,
Jirka


Why can't you have a callback in the client that the daemon can call
when it has finished?



What you suggest is non-blocking call on client-side. I want a non-blocking execution on the server-side, to be able to handle other requests.
begin:vcard
fn:Jiri Moskovcak
n:Moskovcak;Jiri
email;internet:jmoskovc@xxxxxxxxxx
x-mozilla-html:FALSE
version:2.1
end:vcard

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux