diff options
author | John Christopher Anderson <jchris@apache.org> | 2010-09-27 20:06:22 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2010-09-27 20:06:22 +0000 |
commit | 7665e449cdfff1e660ed2bbac3de4507cb063a18 (patch) | |
tree | a3c7994475d955fce448af9a8c60c202c0e92f6e /src/couchdb/couch_query_servers.erl | |
parent | 6c6db011c2064597526c6f36878a282238dd2bf2 (diff) |
CommonJS support in map functions
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001895 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_query_servers.erl')
-rw-r--r-- | src/couchdb/couch_query_servers.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/couchdb/couch_query_servers.erl b/src/couchdb/couch_query_servers.erl index 341f7204..85470a95 100644 --- a/src/couchdb/couch_query_servers.erl +++ b/src/couchdb/couch_query_servers.erl @@ -16,7 +16,7 @@ -export([start_link/0]). -export([init/1, terminate/2, handle_call/3, handle_cast/2, handle_info/2,code_change/3]). --export([start_doc_map/2, map_docs/2, stop_doc_map/1]). +-export([start_doc_map/3, map_docs/2, stop_doc_map/1]). -export([reduce/3, rereduce/3,validate_doc_update/5]). -export([filter_docs/5]). @@ -47,8 +47,13 @@ start_link() -> gen_server:start_link({local, couch_query_servers}, couch_query_servers, [], []). -start_doc_map(Lang, Functions) -> +start_doc_map(Lang, Functions, Lib) -> Proc = get_os_process(Lang), + case Lib of + {[]} -> ok; + Lib -> + true = proc_prompt(Proc, [<<"add_lib">>, Lib]) + end, lists:foreach(fun(FunctionSource) -> true = proc_prompt(Proc, [<<"add_fun">>, FunctionSource]) end, Functions), |