Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 68366 invoked from network); 4 Jun 2009 05:31:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Jun 2009 05:31:32 -0000 Received: (qmail 44074 invoked by uid 500); 4 Jun 2009 05:31:44 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 43992 invoked by uid 500); 4 Jun 2009 05:31:43 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 43982 invoked by uid 99); 4 Jun 2009 05:31:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jun 2009 05:31:43 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jchris@gmail.com designates 209.85.218.218 as permitted sender) Received: from [209.85.218.218] (HELO mail-bw0-f218.google.com) (209.85.218.218) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jun 2009 05:31:32 +0000 Received: by bwz18 with SMTP id 18so527521bwz.11 for ; Wed, 03 Jun 2009 22:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=R9NOZHBxHLElYgJ5HXadZNJlJbKt/lJ6m3PArFl/Spo=; b=Y0ezSkcLthdf712xsAvC7FCgbrqKn3MRL+vrxLman0LCuyuGzOCZm7+QLT2o/BGnvJ SXvGpy8y8BSucUxlc1+CtexzxIliBKXwJfVi89CDaeMG//QSA45WEVGqwcYf1TsNpxk8 6/xvUJ7QPAHAku7WbUyAVaFGqhhl6xa+2QEnY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=wEs9q4rkqnJloPVKSMIIfIsL3T3jEX7A0Oh2HQMsXPLbuyV8YAgVRjYH7We/NZc0UY kvRQTULrCtM4nxWyoIfgCX5aGJNKZ2bGhX7Y9tPwLoHsay9/soz/brC/1ZeHey97w0Mh 87vUpXfxBUSHDe7Xzwnc4tz8+qFFP/n7hs7p8= MIME-Version: 1.0 Sender: jchris@gmail.com Received: by 10.204.120.201 with SMTP id e9mr1587502bkr.187.1244093471530; Wed, 03 Jun 2009 22:31:11 -0700 (PDT) Date: Wed, 3 Jun 2009 22:31:11 -0700 X-Google-Sender-Auth: c027910f773fdd20 Message-ID: Subject: list iterators From: Chris Anderson To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Couchers, I've been hacking on that list iterator stuff I'd been talking about. Here's the branch (for now) http://github.com/jchris/couchdb/tree/list_iterators The difference with this branch is that you call getRow() when you want another view row, and you can send() a chunk (string) whenever you want, instead of being constrained to functions which had to return after each call. This gives you more freedom to manage your own state between calls. Here's an example of what the syntax comes out like http://github.com/jchris/couchdb/blob/5345878fad321319422c4c6e56ab5e0537e79ebc/share/www/script/test/list_views.js#L42 Once I do a little more edge case testing I'll bring it into the Apache repository as a branch. I think this is clearly better than the current list (head / row / tail) API. What do you think? Chris -- Chris Anderson http://jchrisa.net http://couch.io