Hi Matt.
Thanks for your answer.
I'll have an erlang http client "subscribe" to the continuous changes
feed and react as needed.
The sequence number is a nice touch, it will be helpful to recover from crashes.
-teo
On Thu, Nov 12, 2009 at 4:04 PM, Matt Goodall <matt.goodall@gmail.com> wrote:
> 2009/11/12 Matteo Caprari <matteo.caprari@gmail.com>:
>> Hi.
>>
>> i need to notify an erlang process each time a couchdb database is updated.
>> Reading the docs I learned how to use [update_notification] to fire a
>> script that sends that message.
>>
>> It's fine, but my feeling is that sending a message from couchdb
>> would be faster than starting a new 'heavy' process each time.
>
> Actually, update_notification processes are not started each time.
> They stay running and communicating with the CouchDB unless they are
> either killed, exit or die ... in which case CouchDB starts it up
> again.
>
> However, I would recommend looking at the _changes API. It lets you
> decouple these sorts of processes from the CouchDB server, making it
> much easier to manage, distribute and upgrade. See
> http://wiki.apache.org/couchdb/HTTP_database_API#Changes for details,
> specifically the 'longpoll' or 'continuous' feed.
>
> - Matt
>
>>
>> I'd like to hear some comments. Thanks!
>> --
>> :Matteo Caprari
>> matteo.caprari@gmail.com
>>
>
--
:Matteo Caprari
matteo.caprari@gmail.com
|