couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damien Katz (JIRA)" <>
Subject [jira] Commented: (COUCHDB-377) allow native view servers
Date Mon, 22 Jun 2009 18:44:07 GMT


Damien Katz commented on COUCHDB-377:

I think we should not try to avoid the JSON term conversion, as it's the most stable API and
it's a low cost conversion, everything is still Erlang terms. It's the serialization to a
string and back that's expensive.

I think we should go ahead and change the get os_process call to return a record, instead
of a tuple, something like:

-record(proc, {

The prompt_fun replaces and wraps couch_os_process:prompt and now we call the prompt_fun with
the same args. If it's an OS process, it's the same call to couch_os_process:prompt, otherwise
it's a function that calls apply(Mod, Fun, [Pid, Args]) or something like that.

The patch otherwise looks good, I don't see any obvious bugs or style problems.

> allow native view servers
> -------------------------
>                 Key: COUCHDB-377
>                 URL:
>             Project: CouchDB
>          Issue Type: Improvement
>            Reporter: Mark Hammond
>         Attachments: native_query_servers.patch
> There has been some discussion on IRC etc about how to support 'native' view servers,
such as 'erlview' in a generic way.  Currently using erlview requires you to modify couch.
> I'm attaching a patch as a first attempt at supporting this.  In summary, the patch now
looks up a new 'native_query_servers' config file section for a list of view_server names
with a {Module, Func, Args} style string specifying the entry-point of the view server.  The
code now passes an additional atom around indicating if the PID is 'native' or 'external',
and map_docs takes advantage of this to avoid the json step.  This patch allows erlview to
work for me, but in theory any erlang code could be used here.
> I'm very new at erlang - please let me know if I should make stylistic or other changes,
or indeed if I should take a different approach completely.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message