2006/11/28, Jos van den Oever <<a href="mailto:jvdoever@gmail.com">jvdoever@gmail.com</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;">
2006/11/28, Mikkel Kamstrup Erlandsen <<a href="mailto:mikkel.kamstrup@gmail.com">mikkel.kamstrup@gmail.com</a>>:<br>> 2006/11/27, Joe Shaw <<a href="mailto:joeshaw@novell.com">joeshaw@novell.com</a>>:<br>> > Hi,
<br>> ><br>> > On Mon, 2006-11-27 at 12:12 +0100, Jos van den Oever wrote:<br>> > > > > Exactly. And having live queries is similar to this.<br>> > > > ><br>> > > > > I'm not the best person to propose an asynchronous language because
<br>> > > > > Strigi has only synchronous queries at the moment. If there's a good<br>> > > > > API, i might change that according to that API.<br>> > > ><br>> > > > Exposing the API over DBUS makes your queries async for free (only
<br>> those<br>> > > > requested over dbus ofcourse :-) ). Any dbus call has an async and a<br>> > > > blocking version, so clients can do what ever they want.<br>> > ><br>> > > Yes, my point was defining a request that returns the results in
<br>> > > packets instead of only one reply. This has the advantage the the gui<br>> > > can show results pretty quickly even if the query is slow.<br>> ><br>> > In Beagle, all searches are inherently asynchronous. The client sends a
<br>> > query request, and a variety of signals are sent back. HitsAdded,<br>> > HitsSubtracted, and Finished are the main ones. As long as the<br>> > connection to the daemon stays open, events can keep being sent to the
<br>> > client. Hence, live queries.<br>> ><br>> > I would suggest a similar setup using unique D-Bus object paths for a<br>> > standardized API. (A synchronous API will be pretty darn slow for large
<br>> > queries, I'm afraid.)<br>><br>> I think everybody wants that (atleast I do). However the idea about<br>> org.freedesktop.search.simple was to have a *simple* interface. Here the<br>> simple only applies to the end user-app developers.
<br>><br>> 1) Targetted at apps where searching is not the main functionality, fx. a<br>> music browser, or filemanager.<br>> 2) There should be no query building on the application end. Just pass the<br>> string as entered by the user to quuery method.
<br>> 3) Should be dead easy to drop in your app with only a few lines of code<br>><br>> The plan was that when we had a simple interface we would move on and define<br>> a more advanced one for people with the need for this.
<br>><br>> The problem is that 2) warrents a simple search language to be defined to<br>> make much sense... 3) is a bit against the nature of your suggestion.<br>><br>> A signal driven query response is dead easy to work with when you Query
<br>> object is a gobject, but when it is a dbus object matters get (a little)<br>> more tricky. I'm not totally against this idea (signal driven query<br>> response), but I can't see how we could KIS.<br><br>You dont have to define the object in the API. Also having an object
<br>is independent of the language. It simply means you have something<br>with a name on the receiving end. E.g.<br>org.freedesktop.search.livequeries/query1. You just define the<br>interface methods. I'll give it a quick shot, but agree with you that
<br>the async API should not go into the simple interface.<br><br>> Do you have any specific idea for a dbus interface?<br>In the search API:<br>method query(in s query, out s queryid)<br>In the livequery API:<br> signal moreHits(in hit a(sa(sas)))
<br> signal finished()<br> method closeQuery()<br>(basically what Joe proposed)</blockquote><div><br>So you think we should use this instead of the current search.simple api? <br><br>What about applications spawning many searches? Think search-as-you-type, context aware desktop, runtime information clusters... Spawning a dbus object for each query could become a huge task. I must admit I have _no_ idea on how well dbus scales on multiple private connections... I fear the answer is "Untested, and expected to be bad". Anyone?
<br><br>Cheers,<br>Mikkel<br><br></div></div>