signal with return value using glib binding

Havoc Pennington hp at redhat.com
Wed Aug 9 14:17:42 PDT 2006



Xavier Claessens wrote:
> Hi everybody,
> 
> I want to have gint returned by a signal but dbus doesn't seems to be
> happy, here is what he says:
> 
>  ** (xchat:6449): WARNING **: Not exporting signal "command_signal" for
> object class "RemoteObject" as it has a return type "gint"
> 
> Is it impossible to have a return value ? Will it be implemented in
> future dbus-glib version ? Or maybe it's already in 0.7x (using 0.62
> here).
> 

With GObject signals can have a return value because signals amount to a 
series of method calls in a deterministic order and it's possible to 
define an algorithm for how these multiple return values map to the 
signal's single return value.

With dbus, there are two issues:
  - the signal emitter has no idea how many or which handlers exist
  - there is no defined order in which the handlers run

A return value would have to be something like "wait N seconds; if any 
handlers have sent us a return value in that time, then return the 
first/last/random one of said values"

Which seems crazy/useless

Havoc



More information about the dbus mailing list