couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harald Kisch <haraldki...@gmail.com>
Subject Re: Post on Trigger
Date Thu, 19 May 2016 12:24:11 GMT
Hi Reddy,

your request seems to be possible for me without any change to the CouchDB
code.
But you may need to think in another way. For me a trigger is nothing else
than a change of a document.
On database-change event you can easily trigger any other script in
dependence whether a attribute in the changed document exists or not.
Also a view index will be updated any time a new document is stored into
CouchDB.
Why you want to call curl behind the scenes is not transparent to me.
For me which urls are called in the background depends on which domain
(dev.url, stage.url, www.url) the app was deployed.
But it could be that I misunderstand your request. Maybe you can make it
more clear to me what you especially want to reach?

Cheers,
Harry

On Thu, May 19, 2016 at 1:49 PM, Reddy B. <reddy.b@live.fr> wrote:

> Hi,
>
> 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.
>
> 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.
>
> 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.
>
> 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...)
>
> 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.
>
> 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.
>
> Cheers,
>
> Reddy
>




-- 

Dipl.-Inf. Harald R. Kisch

Auenstraße 14
80469 München
Germany

Tel: +49 (0) 89 41 61 58 57-6
Mobil DE: +49 (0) 176 56 58 58 38

Skype: harald.kisch
Mail: haraldkisch@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message