Discovering services

Carlos Garcia Campos carlosgc at gnome.org
Thu Jul 6 10:12:52 PDT 2006


El mar, 04-07-2006 a las 18:29 +0200, Tako Schotanus escribió:
> Havoc Pennington wrote:
> > Carlos Garcia Campos wrote:
> >>
> >> Maybe it's better to add a new method instead of using ListNames.
> >
> > Yeah, I think it would be better to add a method that specifically 
> > lists "activatable services" or something and only includes stuff from 
> > .service files (does NOT include the live/running names).
> >
> >> The patch is available here (against cvs head, I haven't been able to
> >> get dbus from anongit):
> >> http://carlosgc.linups.org/files/dbus-list-services.diff
> >
> > It looks pretty good, I would suggest two things:
> >  - separate method from ListNames
> >  - add test coverage - since ListNames itself isn't tested yet this
> >    may be a little work, but it should not be too hard - if you look
> >    at the tests that do an activation, you just need to ListNames after
> >    the activation and be sure the activated name is listed, and call
> >    your new method before the activation to be sure it's listed as
> >    something activatable. You want to hook in to
> >    bus/dispatch.c tests probably which will let you test the OOM
> >    handling.
> >
> >> Another problem we have found with "atomato" is that we need to call
> >> introspect method for every service, but we don't want that a service
> >> which was not active, keep active after returning introspect info.
> >> Is it possible to deactivate services or something like that?
> >
> > This is a pretty major can of worms. In general services should 
> > "self-deactivate" I would say - e.g. after a timeout, or when nobody 
> > is using them.
> >
> > But, activating everything possible seems pretty scary to begin with - 
> > you might be launching apps left and right in essence. Could be 
> > slooooooow and have bizarre user-visible effects such as windows opening.
> But what would be the use  of asking for introspection information on a 
> service that is not running yet? In a lot of cases there won't be any 
> information yet (like for example the service that manages all installed 
> printers) or it might in some other way be dynamically generated/determined.
> 
> So what is the usecase where you would want to know what a non-activated 
> service supports?

It's useful to know, at least, which services are available even if they
are not activated. For example, when I was working on porting
libpanel-applet to dbus each applet had a .service file, so I needed to
know which .service files were available in the system to build the "add
to panel" menu. IMHO it's a reasonable usecase. 

> >
> > If you need this, I think we'd have to look instead at some way to 
> > install the introspect information in files. But, that's a pretty 
> > large project and adds a fair bit of complexity.
> >
> 
> And mostl likely making introspection more difficult which might mean 
> people will be even less inclined to support it.
> 
> But like I said, I'm curious what the usecase is, maybe there is a way 
> (around).
> 
> Cheers,
>  -Tako
> 
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus

-- 
Carlos Garcia Campos (KaL)
   elkalmail at yahoo.es
   carlosgc at gnome.org
   http://carlosgc.linups.org
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
	digitalmente
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060706/a565b213/attachment-0001.pgp


More information about the dbus mailing list