Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AF95D200CCB for ; Thu, 20 Jul 2017 16:42:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id ADFBE16B715; Thu, 20 Jul 2017 14:42:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BF53516B711 for ; Thu, 20 Jul 2017 16:42:45 +0200 (CEST) Received: (qmail 13854 invoked by uid 500); 20 Jul 2017 14:42:44 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 13842 invoked by uid 99); 20 Jul 2017 14:42:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jul 2017 14:42:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E1866C343E for ; Thu, 20 Jul 2017 14:42:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.631 X-Spam-Level: ** X-Spam-Status: No, score=2.631 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 1v83rw9Benx2 for ; Thu, 20 Jul 2017 14:42:33 +0000 (UTC) Received: from mail-qt0-f170.google.com (mail-qt0-f170.google.com [209.85.216.170]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 164015FB06 for ; Thu, 20 Jul 2017 14:42:33 +0000 (UTC) Received: by mail-qt0-f170.google.com with SMTP id b40so25249614qtb.2 for ; Thu, 20 Jul 2017 07:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=I/X+U2H85myzGxQSmrndPMOnMVEZqkD26lBCLSuHZhQ=; b=G/GU93/0TZVtA2QTMtL1aMsjYvChK1LLE/rXQqKiAcs6cE5f4t0mLDC09zper5+owl TBmRsY50KRuRVvDlfTubGXwvrvJZOUNqQK5BFRUXfxr3alnvV4Vz5Op+kb17jnP7qaym HLXexeVzCq4kaQ7Dpet2NKpuzE1U54Ls3Qr6uh6hRFVq++B1aY4Poq3oa9+3Kz7OeXXk 291Gw1bLLWow8vXsCCSXY/kWRACg8wY6ZSz8jJsphqciyQg6E4gNhNArbbP4Cy17ZTGg PPrxAJBKaf0tPLxze/oKBEHOS9i9d8UWCmtj+rZ88Mw2nJccgaLQZWRVNJYXH9bPqAAk klbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=I/X+U2H85myzGxQSmrndPMOnMVEZqkD26lBCLSuHZhQ=; b=o7gh/R+lUr/g3Pp12JFcE0Afk4vnUu6xMdaxj6eacf7m9ky1mIwS4oc+u34bq4GKtS kw9nILFJfbKytDFy4HqRqtYSZco77fsPOHBozDAp5rSOhtz1F2p43RlJOP7mz6Gp5Bj6 HvNiQ9Wi2uzVzzHyywlfEtan4eAz6Xc3fYnfp3YJ/C9pWLP+hJEdu02ah3yDYqp3tnud ddOcMOSmfTVZmUHyH1YyD3Z44KUKl8+/36F8YM3y1LcgEAm79XjNooE4wNzvIikhVifc W0UmetWcCHdcXO0iN4k9FRKwT0oEWG/Ec5RXM4/Zn0wxC8pf7/dld442xIEHUiGCYfHl cszA== X-Gm-Message-State: AIVw113xPegf70HaR4n7rGtue6K1li2ccHtkU93dh+bqQKnMUmpMrIZ+ GGIxEF2lfa8KtY3MgPLTTZm0dXuOSg== X-Received: by 10.55.70.76 with SMTP id t73mr5184015qka.41.1500561752360; Thu, 20 Jul 2017 07:42:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sean Lang Date: Thu, 20 Jul 2017 14:42:21 +0000 Message-ID: Subject: =?UTF-8?Q?Re=3A_Don=E2=80=99t_Just_Relax=3B_Slouch=3A_A_JS_Client_for_Couc?= =?UTF-8?Q?hDB_that_Does_the_Heavy_Lifting?= To: user Content-Type: multipart/alternative; boundary="001a114abf6a368d300554c0c2d9" archived-at: Thu, 20 Jul 2017 14:42:46 -0000 --001a114abf6a368d300554c0c2d9 Content-Type: text/plain; charset="UTF-8" Except, I can't just pass a `.each` function to one of the hundreds of existing stream related utilities that have been published on npm. I can't use flow control or destroy the iterator once I've read enough data, unlike a stream. On Thu, Jul 20, 2017, 09:33 Geoffrey Cox wrote: > Hi Sean, > > Sure, you could use a stream, but you'd probably end up writing a bunch of > code to do what you can do in just a few lines with slouch. > > For example, here is an example of using the _all_docs API in nano: > https://github.com/redgeoff/slouch/blob/master/examples/nano-all.js > > And here is a similar example using slouch: > https://github.com/redgeoff/slouch/blob/master/examples/all.js > > Slouch really gets cool when you start using a Throttler to provide some > concurrency without totally slamming your CPU: > > https://github.com/redgeoff/slouch/wiki/Don%27t-just-relax.-Slouch%21#example-2---process-a-max-of-5-docs-concurrently > > > Geoff > > > > On Wed, Jul 19, 2017 at 10:26 PM Sean Lang wrote: > > > `.each` is kinda weird for iteration. Can't you just return a standard > > Node.js stream? > > > > On Wed, Jul 19, 2017, 09:31 Geoffrey Cox wrote: > > > > > Hi, > > > > > > We just released, Slouch, another JS client for CouchDB. On the > surface, > > it > > > may seem like we have reinvented the wheel as there is already nano and > > > nano is pretty awesome. However, Slouch approaches things from a > slightly > > > different perspective and has allowed us to greatly simply our > > application > > > layer. > > > > > > You can read more about it on medium. > > > < > > > > > > https://medium.com/@redgeoff/dont-just-relax-slouch-a-js-client-for-couchdb-that-does-the-heavy-lifting-d8232eba8e2c > > > > > > > > > > Or, jump straight the repo. > > > > > > I welcome any feedback and hope this helps others. > > > > > > Thanks. > > > > > > Geoff > > > > > > --001a114abf6a368d300554c0c2d9--