[Xapian-discuss] Node.js binding

Dan Colish dcolish at gmail.com
Fri Oct 14 16:07:22 BST 2011


On Fri, Oct 14, 2011 at 4:15 AM, Richard Boulton <richard at tartarus.org>wrote:

> On 14 October 2011 10:50, Liam <xapian at networkimprov.net> wrote:
> > Wondering if anyone's considered/planning a Node.js binding? (I can
> > contribute to the effort; I have modest experience with the V8 api;
> though
> > haven't started with xapian yet.)
>
> I took a look at making one a while ago (when Node was pretty new) -
> actually making an extension which calls some Xapian functions from
> node is pretty easy to do by hand (though wrapping the full API would
> be harder - and I don't think SWIG has any stable V8/javascript
> support currently, so it would either have to be done manually or swig
> would have to be modified.
>
> The significant problem though is that many Xapian calls are
> long-running, so need to be run in a sub-thread or sub-process.  Is
> there any built-in support for that sort of thing in Node now? (there
> wasn't when I last looked).
>
> Alternatively, you could just make a client in V8 for a search server
> built around Xapian (eg; http://restpose.org).
>
> --
>


I also looked into this a few months ago and I think a naive implementation
would be easy. The issue I have is how to avoid blocking the main event loop
in Node.js. Now that I've thought about it a bit more, I think using futures
or promises to avoid blocking would be an alternative to just forking and
polling. Otherwise, I think that an API client to Restpose is a reasonable
solution

--Dan


More information about the Xapian-discuss mailing list