AddMatchWithID / RemoveMatchById

Curtis Maloney cmaloney at cardgate.net
Tue Feb 19 19:21:11 PST 2008


Ryan Lortie wrote:
> A simple example:
> 
> Imagine the dconf library wants to receive all "notify" signals subject
> to some match rule like /apps/foo/.  It can call some function like
> 
> g_bus_match ("[rule for /apps/foo/]", my_callback, user_data);
> 
> Someone else (in the same application) wants to make legitimate use of
> dconf's public DBus API and registers a watch on /apps/bar/.
> 
> g_bus_match ("[rule for /apps/bar/]", other_callback, user_data);
> 
> As a client library implementation, I see an arriving signal from dconf
> for [some path].  Without rerunning the signal matching rules, what
> callback do I invoke?  If I receive a match ID then I can match that up
> with the ID that I generated for a particular invocation of
> g_bus_match() and would then know which callback to invoke.

I know in my usage, I want EVERYONE who's registered an interest in the signal 
to get notified.

Why would you only deliver it to one, when both have legitimately registered an 
interest?

-- 
Curtis Maloney
cmaloney at cardgate.net



More information about the dbus mailing list