Re: fourth report: cheese integration



Cosimo Cecchi schrieb:
On Mon, 2008-06-23 at 10:34 +0200, Felix Kaser wrote:

The problem is: When cheese gets called via dbus, it enters a specific method (remote method). In this method cheese should wait until the user has taken a picture, then return the path via dbus. But what about the waiting? Well the client blocks, but this is not a problem in my opinion. The thing is, how to make the "waiting" of the cheese-method? Active waiting (while (return_path == null) wait(1); ) sounds really ugly! But what else? Make a new thread? Work with signals? Change the whole work flow?

Can somebody help me with that? I'm sure one of you has had similar problems and has solved them in a nice way :)

I am having my first experiences with DBus too these days ;)
It seems that an object on the bus can have signals too, other than
methods. So a very simple way to solve your issue could be splitting the
picture acquisition process into two steps: first you call the remote
method on the cheese manager, then, when the picture is ready, a signal
is emitted from the manager itself, with the path as argument.

Nice idea...but who will be listening for the signal? The client? So the client calls the remote method and then waits for the signal?
Hope that I understood your problem correctly ;)

Cheers!

Salut =)


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