Discovering services
Carlos Garcia Campos
carlosgc at gnome.org
Thu Jul 6 10:03:06 PDT 2006
El mar, 04-07-2006 a las 02:10 -0400, Havoc Pennington escribió:
> Carlos Garcia Campos wrote:
> >
> > Maybe it's better to add a new method instead of using ListNames.
> >
sorry for the delay, I'm very busy these days.
> 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.
where should I add the test stuff? bus/test.c? I still don't know how
the tests work.
At the moment here is an updated patch:
http://carlosgc.linups.org/files/dbus-list-services2.diff
I'll add test coverage and documentation to dbus-specification.
> > 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.
Exactly, when nobody is using them, but how can a service know when it's
not going to be used anymore? Maybe a generic interface, with ref/unref
methods that services could implement would be a solution.
> 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.
yeah I agree
> 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.
It would be a good solution IMHO.
> Havoc
>
--
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/58792d19/attachment.pgp
More information about the dbus
mailing list