Re: supporting notifications from backends
- From: Mark McLoughlin <mark skynet ie>
- To: Cyrille Moureaux <Cyrille Moureaux Sun COM>
- Cc: gconf-list gnome org
- Subject: Re: supporting notifications from backends
- Date: Tue, 30 Mar 2004 16:43:30 +0100
Hi Cyrille,
On Mon, 2004-03-29 at 13:52, Cyrille Moureaux wrote:
> Hi Mark,
>
> > Ah, I hadn't thought of that extra complexity for the backends. Because
> >of that and the fact that, as you say, allowing a different callback per
> >listener is useless I've added back a set_notify_func() vtable member.
> >
> >
> I think we also need to mention in the documentation that the
> notification function will only be called once per change relevant to at
> least one listener, and not once per registered listener for that
> change. In other words, if there are two listeners for
> /apps/metacity/general, one for /apps/metacity and twenty lazy ones for
> /apps, the notification function should be called once by the backend if
> something changes in /apps/metacity/general and not twenty-three times.
Sounds good. I've committed the change below.
Cheers,
Mark.
Index: doc/gconf/tmpl/gconf-backend.sgml
===================================================================
RCS file: /cvs/gnome/gconf/doc/gconf/tmpl/gconf-backend.sgml,v
retrieving revision 1.10
diff -u -p -r1.10 gconf-backend.sgml
--- doc/gconf/tmpl/gconf-backend.sgml 30 Mar 2004 15:19:08 -0000 1.10
+++ doc/gconf/tmpl/gconf-backend.sgml 30 Mar 2004 15:43:51 -0000
@@ -257,6 +257,23 @@ order to force the backend to be able to
</row>
<row>
+<entry>@set_notify_func</entry>
+
+<entry>
+If the backend wishes to notify the daemon of changes in the value of
+keys it must implement this method. In order to notify the daemon
+of a change, the backend should invoke the supplied @notify_func with
+ user_data Backends must not notify the daemon of changes which the
+daemon has not expressed interest in by adding a listener with
+ add_listener Also, the backend must make every effort to minimise the
+number of notifications it emits. For example, if the daemon has added
+a listener for /apps and another for /apps/foo and the value of
+/apps/foo/bar changes, the backend should only emit a single notification.
+</entry>
+
+</row>
+
+<row>
<entry>@add_listener</entry>
<entry>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]