Re: [notmuch] [PATCH] Calls to notmuch get queued and executed asynchronously.

Subject: Re: [notmuch] [PATCH] Calls to notmuch get queued and executed asynchronously.

Date: Fri, 30 Dec 2011 10:52:17 +0000

To: Daniel Schoepe, James Vasile, notmuch@notmuchmail.org

Cc:

From: David Edmondson


On Fri, 21 Oct 2011 22:50:48 +0200, Daniel Schoepe <daniel@schoepe.org> wrote:
> On Tue, 23 Feb 2010 11:32:51 -0500, James Vasile <james@hackervisions.org> wrote:
> > Added notmuch-enqueue-asynch to replace calls to
> > notmuch-call-notmuch-process.  Calls to notmuch are then queued and
> > executed asynchronously.  If the db is busy and we get an error saying
> > it was locked, keep trying until the db is no longer busy.  Errors go
> > in a buffer as per usual.
> 
> I discovered this patch a while ago and it almost applies cleanly (the
> conflicts are easy to fix though) and it has made the emacs UI for
> notmuch _much_ more responsive and enjoyable for me. As discussed on
> IRC, issues such as where to handle retries in case the database is
> locked should probably be handled in the notmuch binary instead of each
> UI.
>
> I am however unaware of any patches to accomplish that and with the pace
> of development / patch reviews the way it is at the moment, this patch
> is a really helpful stop-gap (performing calls to notmuch asynchronously
> is useful independently of where concurrency issues are handled though)
> for me. If someone else agrees, I can fix the conflicts for this patch
> and send the revised version to the list.

It would be good to have an updated version of this patch if it is still
considered useful, though I don't suffer particularly from lag in the
emacs UI.

One concern is the string searching on the output of 'notmuch' to detect
the database locked condition. Perhaps 'notmuch' could be made to
return a specific error code in that case, negating the need to string
match?
part-000.sig (application/pgp-signature)

Thread: