Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 65543 invoked from network); 27 Jan 2011 20:51:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jan 2011 20:51:06 -0000 Received: (qmail 93335 invoked by uid 500); 27 Jan 2011 20:51:06 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 93042 invoked by uid 500); 27 Jan 2011 20:51:05 -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 93034 invoked by uid 99); 27 Jan 2011 20:51:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jan 2011 20:51:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jan 2011 20:51:04 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0RKoiCC004114 for ; Thu, 27 Jan 2011 20:50:44 GMT Message-ID: <1078595.248801296161444348.JavaMail.jira@thor> Date: Thu, 27 Jan 2011 15:50:44 -0500 (EST) From: "Benoit Chesneau (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-1046) support load of external erlang modules in couchdb. In-Reply-To: <10951018.241671296144284413.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1046?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D12= 987752#action_12987752 ]=20 Benoit Chesneau commented on COUCHDB-1046: ------------------------------------------ Installing in $PREFIX/lib/couchdb/erlang/lib would make difficult to detec= t plugins or are you suggesting $PREFIX/lib/couchdb/erlang/lib/plugins ? Which could be better so we make sure plugins are related to one couchbd ve= rsion. - beno=C3=AEt - benoit > support load of external erlang modules in couchdb.=20 > ---------------------------------------------------- > > Key: COUCHDB-1046 > URL: https://issues.apache.org/jira/browse/COUCHDB-1046 > Project: CouchDB > Issue Type: New Feature > Components: Database Core > Reporter: Benoit Chesneau > Fix For: 1.2 > > Attachments: couchdb-plugins-003.patch, couchdb-plugins-004.patch= , couchdb-plugins-01.patch, couchdb-plugins-02.patch > > > If you want to add external modules in CouchDB and load them , you need t= o set the ERL_FLAGS environnement variable to the path of a module.=20 > The attached patch allows couchdb to load plugins from plugin key in couc= hdb section. It add needed path to the code path, so the vm can find module= s. > ex: > [couchdb] > plugins =3D plugin1, plugin2 > Each plugin can have its own section where it set the binaries patch, ev= entually if a service need to be added to the supervision you can set the m= odule and function to load like in daemon section and tel if it's a supervi= sor or simple service. > It also allows couchdb to load a plugin service (gen_server or such) to t= he supervision. You can choose if the service is a simple daemon or a super= visor. > ex: > [plugin1] > code_path =3D /path/to/plugin1/ebin > daemon =3D {module, function, [Args]} > supervisor =3D false > Let me know what you think about it. This patch is really useful here and= allows me to dynamically load modules I want. Also it eases the integratio= n of external module. For ex I can load my couchapp_ng modules with this li= nes in local.ini :=20 > [couchdb] > plugins =3D couchapp-ng > [couchapp-ng] > code_path=3D/Users/benoitc/work/couchapp_ng/ebin > daemon =3D {couchapp_ng_routes, start_link, []} > [httpd_design_handlers] > _app =3D {couchapp_ng_httpd, handle_app_req} > [couchapp_ng_handlers] > rewrite =3D {couchapp_ng_handlers, rewrite_handler} > proxy =3D {couchapp_ng_handlers, proxy_handler} > and can do the same with geocouch etc. Tested here with these modules. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.