Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 71950 invoked from network); 12 Feb 2009 09:57:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Feb 2009 09:57:55 -0000 Received: (qmail 85873 invoked by uid 500); 12 Feb 2009 09:57:55 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 85827 invoked by uid 500); 12 Feb 2009 09:57:54 -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 85816 invoked by uid 99); 12 Feb 2009 09:57:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2009 01:57:54 -0800 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 dionne@dionne-associates.com designates 67.222.39.34 as permitted sender) Received: from [67.222.39.34] (HELO outbound-mail-154.bluehost.com) (67.222.39.34) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 12 Feb 2009 09:57:43 +0000 Received: (qmail 8187 invoked by uid 0); 12 Feb 2009 09:55:08 -0000 Received: from unknown (HELO host183.hostmonster.com) (74.220.207.183) by outboundproxy5.bluehost.com with SMTP; 12 Feb 2009 09:55:08 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=dionne-associates.com; h=Received:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer:X-Identified-User; b=tre++y/W+YDh9WmR9BQjhP3pS/vq+c7+MW4+Yf09F3nN3CJrYQY9zfI1jqmrfngYeisiJKPAnhnfzgDQ6tfTmzfJ1V6Kb5SF7QaHWIUMP2iaxi0T+c1r4M5CM3jp3ck3; Received: from h-67-100-107-15.nycmny83.dynamic.covad.net ([67.100.107.15] helo=[192.168.2.100]) by host183.hostmonster.com with esmtpa (Exim 4.69) (envelope-from ) id 1LXYJt-0001kL-3L for dev@couchdb.apache.org; Thu, 12 Feb 2009 02:57:21 -0700 Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: <20090212075948.GH22018@delora.autosys.us> References: <20090211223641.GE22018@delora.autosys.us> <20090212075948.GH22018@delora.autosys.us> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <0D122F0C-4DA4-4D77-B17A-1075EA63C411@dionne-associates.com> Content-Transfer-Encoding: 7bit From: Robert Dionne Subject: Re: Erlang API Date: Thu, 12 Feb 2009 04:56:42 -0500 To: dev@couchdb.apache.org X-Mailer: Apple Mail (2.753.1) X-Identified-User: {2551:host183.hostmonster.com:dionneas:dionne-associates.com} {sentby:smtp auth 67.100.107.15 authed with dionne@dionne-associates.com} X-Virus-Checked: Checked by ClamAV on apache.org On Feb 12, 2009, at 2:59 AM, Michael McDaniel wrote: > > On Wed, Feb 11, 2009 at 02:57:19PM -0800, Chris Anderson wrote: >> On Wed, Feb 11, 2009 at 2:36 PM, Michael McDaniel >> wrote: >>> >>> I'll post some code when it does a bit more than gurgle bubbles. >> >> It sounds like you are on the right track, and you pointed out the >> bits 'erlview' etc that I saw reading it. The only other thing I see >> (which is probably me missing stuff), is how does this work if we >> want >> to run multiple distinct views concurrently? > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > -module(erlview). > -behaviour(gen_server) > > > Although the map fun helpers are not written as handle_call funs, so > it is not entirely clear to me about the multiple concurrent views. > That is something I started thinking about two or three days ago > myself so some testing will be called for. Though I do think it > will work ok if I am understanding correctly that > couch_query_servers:map_docs/2 always initiates the views (well, > except after an add_fun when map_docs runs through some as-of-yet > unknown-to-me method). Because couch_query_servers:map_docs/2 > calls couch_os_process:prompt/2 which uses gen_server:call/2. > > I debated about allowing any and all arbitrary Erlang code in the > map funs versus having helper funs which the map fun calls > (e.g. all_content/2 returns all docs whose content matches a list > of field/content tuples; > all_fields/2 returns all docs which contain all fields in a list; > etc. And a list output fields can be specified.). > > I wound up allowing any and all arbitrary Erlang code in the map > funs, and also wrote some helper funs to hide some of the underlying > data. > > As you can surmise, it is not using plain emit(doc.name, [doc]) in > the map funs. > > Kind of a mess but, as you alluded to, a start. > > ~M > > >> >> I haven't seen your server code yet, but I for one would be >> excited to >> help port some parts of main.js over to it. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > I look forward to the help. > > ~M > >> >>> >>> >>> Please, if there is some activity to change CDB internals to >>> simplify a native Erlang view server or create a more direct >>> interface, let me know so I don't go too far down this road. >> >> We'll eventually want to sandbox the Erlang (not sure if there are >> libraries for that yet). If you keep up this work, likely you'll be >> leading the charge for Erlang view servers. >> >>> >>> No sense replicating effort (only databases!). >>> >> >> There's an active community of people forking this CouchDB git repo. >> If you worked on your code in public there you might get some helpers >> showing up. >> >> http://github.com/halorgium/couchdb/ > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > ^ > > Not exactly sure what "forking this CouchDB git repo" means. > > My goal is to clean up existing code and get it posted by early > next week. I really need to write up a little bit of "howto" > for local.ini additions, compile and install instructions, and > couch_query_servers.erl changes/compile help. Git is definitely worth the investment in learning, the guides at GitHub are very useful. A key thing is that branches are dirt cheap. This page in particular describes a common workflow I've found very good: http://github.com/guides/fork-a-project-and-submit-your-modifications > > > Do you have some simple instructions on how to get the code > posted, or should I go read the http://github.com/guides/home > links? I have only recently started reading about git. > > ~Michael > >> >> Chris >> >> -- >> Chris Anderson >> http://jchris.mfdz.com > > -- > Michael McDaniel > Portland, Oregon, USA > http://trip.autosys.us > http://autosys.us > >