lib/query: Fix notmuch_threads_t to stream results rather than blocking.
authorCarl Worth <cworth@cworth.org>
Tue, 24 Nov 2009 04:18:57 +0000 (20:18 -0800)
committerCarl Worth <cworth@cworth.org>
Tue, 24 Nov 2009 04:18:57 +0000 (20:18 -0800)
commitba3554b8045e16ae883d559b7e575e8aca00f6d2
treed53712e4ffcd65ba729921df676eeb3711c3e5f8
parent1fd8b7866f189a66e4491b01452f476371759f91
lib/query: Fix notmuch_threads_t to stream results rather than blocking.

Previously, notmuch_query_search_threads would do all the work, so the
caller would block until all results were processed. Now, we do the
work as we go, as the caller iterates with notmuch_threads_next. This
means that once results start coming back from "notmuch search" they
just keep continually streaming.

There's still some initial blocking before the first results appear
because the notmuch_messages_t object has the same bug (for now).
lib/query.cc