From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A8E7D431FB6 for ; Sat, 12 Feb 2011 22:29:56 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zX05MGyYOqyL for ; Sat, 12 Feb 2011 22:29:55 -0800 (PST) Received: from mail-vw0-f53.google.com (mail-vw0-f53.google.com [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 9858C431FB5 for ; Sat, 12 Feb 2011 22:29:55 -0800 (PST) Received: by vws8 with SMTP id 8so2612101vws.26 for ; Sat, 12 Feb 2011 22:29:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.75.20 with SMTP id w20mr3108401vcj.34.1297578592171; Sat, 12 Feb 2011 22:29:52 -0800 (PST) Received: by 10.220.86.135 with HTTP; Sat, 12 Feb 2011 22:29:52 -0800 (PST) X-Originating-IP: [150.101.115.228] In-Reply-To: <87pqrgn4nr.fsf@yoom.home.cworth.org> References: <87pqrgn4nr.fsf@yoom.home.cworth.org> Date: Sun, 13 Feb 2011 17:29:52 +1100 Message-ID: Subject: Re: About the json output and the number of results shown. From: Jeff Waugh To: notmuch@notmuchmail.org Content-Type: multipart/alternative; boundary=0016e65c8a4a0df6fe049c240f25 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 06:29:56 -0000 --0016e65c8a4a0df6fe049c240f25 Content-Type: text/plain; charset=UTF-8 On Sat, Jan 29, 2011 at 07:40, Carl Worth wrote: > One idea I've had for this is to change the output (perhaps with a > command-line option) to avoid emitting the outer array. That is, the > results would instead be a series of independent JSON objects rather > than a single JSON object. That should let the application treat things > quickly by simply calling the JSON parser for each complete > object. It might be useful to model this on the Twitter streaming API, which just delivers a lot of JSON + '\r\n' (large objects straddle http chunks). > (Though, here, the application would likely want a cheap way to > know when the input represented a complete object.) > Is that necessary? You're definitely going to get a \r\n or an EOF at some point. :-) - Jeff --0016e65c8a4a0df6fe049c240f25 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Sat, Jan 29, 2011 at 07:40, Carl Worth=C2=A0w= rote:
One idea I'v= e had for this is to change the output (perhaps with a
command-line option) to avoid emitting the outer array. That is, the
results would instead be a series of independent JSON objects rather
than a single JSON object. That should let the application treat things
quickly by simply calling the JSON parser for each complete
object.

It might be useful to model this on= the Twitter streaming API, which just delivers a lot of JSON + '\r\n&#= 39; (large objects straddle http chunks).
=C2=A0
(Though, here, the application would likely want a cheap way to
know when the input represented a complete object.)
Is that necessary? You're definitely going to get a \r\n o= r an EOF at some point. :-)

- Jeff
--0016e65c8a4a0df6fe049c240f25--