Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BFE652009D9 for ; Thu, 19 May 2016 18:13:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BCDFD160A00; Thu, 19 May 2016 16:13:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0F5041609AE for ; Thu, 19 May 2016 18:13:08 +0200 (CEST) Received: (qmail 49664 invoked by uid 500); 19 May 2016 16:13:08 -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 49653 invoked by uid 99); 19 May 2016 16:13:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 May 2016 16:13:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id AF06C180536 for ; Thu, 19 May 2016 16:13:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3 X-Spam-Level: *** X-Spam-Status: No, score=3 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id zbzTOqZJPfIn for ; Thu, 19 May 2016 16:13:03 +0000 (UTC) Received: from monoceres.uberspace.de (monoceres.uberspace.de [95.143.172.184]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 301AD60E43 for ; Thu, 19 May 2016 16:13:03 +0000 (UTC) Received: (qmail 29988 invoked from network); 19 May 2016 16:13:01 -0000 Received: from localhost (HELO ?10.0.0.11?) (127.0.0.1) by monoceres.uberspace.de with SMTP; 19 May 2016 16:13:01 -0000 From: Jan Lehnardt Content-Type: multipart/alternative; boundary="Apple-Mail=_0C18D14E-2E86-4376-B88C-97293BCCECD1" Message-Id: <7936968A-FEA2-453C-81C9-EFCEC282C0F3@apache.org> Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Post on Trigger Date: Thu, 19 May 2016 18:12:59 +0200 References: To: dev@couchdb.apache.org In-Reply-To: X-Mailer: Apple Mail (2.3124) archived-at: Thu, 19 May 2016 16:13:09 -0000 --Apple-Mail=_0C18D14E-2E86-4376-B88C-97293BCCECD1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 19 May 2016, at 18:03, Matthew Rijk wrote: >=20 > How can i unsubscribe to this feed This is the documentation: = http://docs.couchdb.org/en/1.6.1/api/database/changes.html Best Jan -- >=20 > On Thu, May 19, 2016 at 9:06 AM, Jan Lehnardt wrote: >=20 >> Heya, >>=20 >> the easiest way to build this today is with a CouchDB External: >> http://docs.couchdb.org/en/1.6.1/externals.html that listens to a >> _changes feed. >>=20 >> You can use changes feed filters ( >> http://docs.couchdb.org/en/1.6.1/api/database/changes.html) to get = the >> =E2=80=9Conly when a doc is emitted=E2=80=9D type of event you = mention (or you filter that >> in your external script). =46rom the script then you can do whatever = you want. >>=20 >> A CouchDB External is started and stopped (and kept alive) by CouchDB >> itself, so you are saving yourself the effort of a system integration >> startup script. >>=20 >> Best >> Jan >> -- >>=20 >>=20 >>> On 19 May 2016, at 13:49, Reddy B. wrote: >>>=20 >>> Hi, >>>=20 >>> I am fairly new to CouchDb and loving it so far. I think this = database >> is shockingly underated. I love the "Relax" approach and the design >> choices that have been done, and I hope things will continue with = the same >> philosophy. >>>=20 >>> I couldn't find if this has been discussed before but I was thinking >> that it would be extremely cool to be able to setup triggers that = POST >> arbitrary json to arbitrary endpoints. I think this would be a killer >> feature if there was built-in support for that - and seems to fit = well with >> the HTTP approach of couch. >>>=20 >>> So basically, this would be about allowing us to add an arbitrary = number >> of triggers to any view. Each trigger would be called only if the = view >> emitted "something" and the trigger would receive the document passed = as a >> parameter to the view (this is to take advantage of the update = frequency of >> views) Then in terms of posting, there could be a new built-in = javascript >> function calling curl behind the scenes which can be called from the >> triggers. >>>=20 >>> For the same purpose, it would be interesting to introduce = configuration >> documents at the database level whose properties could be accessed = from >> these triggers (I'm thinking of situations when one would need to = call a >> different URL when in testing, staging, production etc...) >>>=20 >>> In terms of use case, this would allow us to do things as diverse as >> sending email notifications, and maintenance tasks. More generally, = this >> would eliminate the need for most of the maintenance jobs out there = while >> making these systems much more efficient by removing the need to run = jobs >> at arbitrary times even when this is not necessary. Also, since most = web >> frameworks are asynchronous and process each request in a different >> thread, this would be a way to easily parallelize certain = operations. >>>=20 >>> I just wanted to know if there was any chance to see this come out = one >> day or if this would be a "no-go" for design of philosophical = reasons. >>>=20 >>> Cheers, >>>=20 >>> Reddy >>>=20 >>=20 >> -- >> Professional Support for Apache CouchDB: >> https://neighbourhood.ie/couchdb-support/ >>=20 >>=20 --=20 Professional Support for Apache CouchDB: https://neighbourhood.ie/couchdb-support/ --Apple-Mail=_0C18D14E-2E86-4376-B88C-97293BCCECD1--