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

Re: DBUS signals?



On 26/9/24 8:55 am, Jussi Lahtinen wrote:
No, the signals have no destination, they are already for everyone. Also I'm not waiting for an object and the signal name is given in the event. See DBusSignal.

Now there's a trap! AFAICS

<*Every*> tells the runtime what signals to look for. If it's not set then you should only get signals (of some name) that are addressed to you. Now, the system bus signals mostly are not addressed to a particular subscriber and to get them you have to look for them.

<*object*> is the _DBus object_ not an object in your program, nor is it the Gambas DBusObject. For example, I have a program that updates race events from the internet on a scheduled poll basis. It uses separate _DBUS objects_ for every race at each meeting on the day and when it gets an update it raises a DBus event on _that object only_. That way I dont need to process all the races for the day when I get an update signal, only that race. Having said that, in general, DBUS servers don't use objects and just use a general interface that is used by all server objects. Have a look at the screenshot. Its from QDBusViewer. See how its different from "most" DBus server lists.

<*signal*> might be known in your project, but you have to tell the _Gambas DBus component_ itself what _*signal* on the other side_ you are interested in. The signal in this instance is not a Gambas event it is the name of a signal on the DBus bus. The gb.dbus component is the thing that raises an _event_ inside your project, i.e. signal name <> event name.

b

Attachment: QDBusViewer_001.png
Description: PNG image


Follow-Ups:
Re: DBUS signals?BB <adamnt42@xxxxxxxxx>
Re: DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
References:
DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: DBUS signals?BB <adamnt42@xxxxxxxxx>
Re: DBUS signals?Jussi Lahtinen <jussi.lahtinen@xxxxxxxxx>