Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 19374 invoked from network); 7 Jan 2009 01:07:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jan 2009 01:07:54 -0000 Received: (qmail 55813 invoked by uid 500); 7 Jan 2009 01:07:52 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 55775 invoked by uid 500); 7 Jan 2009 01:07:52 -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 55764 invoked by uid 99); 7 Jan 2009 01:07:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jan 2009 17:07:52 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jwall@google.com designates 216.239.45.13 as permitted sender) Received: from [216.239.45.13] (HELO smtp-out.google.com) (216.239.45.13) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jan 2009 01:07:44 +0000 Received: from spaceape8.eur.corp.google.com (spaceape8.eur.corp.google.com [172.28.16.142]) by smtp-out.google.com with ESMTP id n0717Mlt003631 for ; Tue, 6 Jan 2009 17:07:23 -0800 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1231290443; bh=CnxKtKKFc9N6E/3Gn6EbdeazWPQ=; h=DomainKey-Signature:MIME-Version:In-Reply-To:References:Date: Message-ID:Subject:From:To:Content-Type:X-GMailtapped-By: X-GMailtapped; b=rdhsNhT/cAYSuqQvRfym4C/ELKCDkMxqlv2vrIybpxVuvSRT7 G41WcsDMcQPlE3ZjmbBOLp+ocYcvyL7r/lgnw== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: content-type:x-gmailtapped-by:x-gmailtapped; b=c3UU8m6KZZcGBNAq038UpseuFfMgCfLa2jbP6grzZSn99sqoL+jpNZaC/+9t3fiD/ yPwNWVFDJTa/az/f7t6dQ== Received: from bwz8 (bwz8.prod.google.com [10.188.26.8]) by spaceape8.eur.corp.google.com with ESMTP id n0717KBW024600 for ; Tue, 6 Jan 2009 17:07:21 -0800 Received: by bwz8 with SMTP id 8so23463744bwz.14 for ; Tue, 06 Jan 2009 17:07:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.104.68 with SMTP id n4mr16010996fao.4.1231290440280; Tue, 06 Jan 2009 17:07:20 -0800 (PST) In-Reply-To: References: Date: Tue, 6 Jan 2009 19:07:20 -0600 Message-ID: <7c40ded80901061707l543d7736t4b30d9c3fce25212@mail.gmail.com> Subject: Re: erlang notifiers and couchdb From: Jeremy Wall To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=001636c9239e4eed69045fda25cd X-GMailtapped-By: 172.28.16.142 X-GMailtapped: jwall X-Virus-Checked: Checked by ClamAV on apache.org --001636c9239e4eed69045fda25cd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Using the OTP principles you would modify the couch_server_sup.erl file and add a child spec for your module similar to the child spec for the couch_log module in there. I would recommend reading the OTP documentation on Supervisor trees and gen_event behaviours before doing so though. That way you will know what exactly it is that you are doing by adding them. Also it would be good to add you module to the module list in a custome app file. I'm not sure if there is someother hook for this in the code other than _external. On Tue, Jan 6, 2009 at 5:27 PM, Norman Barker wrote: > Hi, > > I have create an erlang module called couch_db_update_my_notifier > which is very similar to couch_db_update_notifier and just prints out > events as they are received to stdout. > > I try to register this module as an event handler as follows within the > module > > start_link(Exec) -> > io:format("***StartLink***"), > couch_event_sup:start_link(couch_db_update, > {couch_db_update_my_notifier, make_ref()}, Exec). > > which is how it is recommended in couch_event_sup.erl > > Problem is how do I actually load couch_db_update_my_notifier and get > start_link invoked, it isn't a daemon, just another listener, and the > updatenotification handler in the ini file is for system processes. > > Is there a way to do this (easily)? I am a newb at erlang and am > writing these modules to find my way around the code. Having multiple > listeners to events is something I will want to have eventually hence > why I am trying this. My aim is to do this in Erlang, I know it can > be done with _external. > > thanks, > > Norman > --001636c9239e4eed69045fda25cd--