2007/5/18, jamie <<a href="mailto:jamiemcc@blueyonder.co.uk">jamiemcc@blueyonder.co.uk</a>>:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Fri, 2007-05-18 at 10:47 +0200, Mikkel Kamstrup Erlandsen wrote:<br>> Hi list,<br>><br>> Considering Havocs blog post <a href="http://log.ometer.com/2007-05.html">http://log.ometer.com/2007-05.html</a>, I<br>> have some questions about temporary/short lived objects on the bus,
<br>> which is of concern for the xesam project[1].<br>><br>> The Setup:<br>> A xesam compliant search engine will spawn Search objects in response<br>> to application requests, and each Search object is considered
<br>> "private" to the application requesting it (see API at [2]). Also it<br>> is to be expected that these Search objects are short lived in the<br>> sense that they wont last the entire session. Many apps will just use
<br>> them by reading a batch of results, maybe listen for changes a a short<br>> while, and then discard the Search (maybe to make another one).<br>><br>> The Problem:<br>> After the app is done using the Search object any traces of it should
<br>> be removed. It is my understanding that you can't generally just<br>> remove an object from the bus since other apps might be using it.<br>> (Partly) because of this we use handles instead of real objects to
<br>> represent Search objects and pass the handle to the methods of the<br>> Search object as you would to a C funtion in glib (fx<br>> org.freedesktop.xesam.search.CloseSearch(search_handle)).<br>><br>> The Question:
<br>> So my question is; is this the way to do it? Or is there a clean way<br>> to let Search objects be real disposable objects on the bus?<br><br>I would suggest when you create a new object it returns the (unique)
<br>object path as a string. That way each object is specific to the calling<br>app. It also avoids having to do match rules for signals as the signals<br>will be specific to the object in question.<br><br>We then have a dispose method which frees it (up to the app to do this)
<br><br>I would say the only issue is how do you automatically dispose of it if<br>the app that created the object disconnects from the bus?<br><br>(we could store the app pid that created it and listen for disconnects<br>
but Im not sure how this is all supposed to work and even if the<br>disconnect signal gives us the pid?)</blockquote><div><br>The problem is: If Search is and object on the bus, then what happens if another app decides to connect to the Search object? AFAIK there's no way to prevent this in dbus, but my knowledge here is pretty limited I must admit (hence my question on this list).
<br><br>Cheers,<br>Mikkel<br></div><br></div><br>