couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matteo Caprari <matteo.capr...@gmail.com>
Subject Erlang _changes consumer
Date Wed, 02 Dec 2009 16:36:28 GMT
Hi.

I've written an erlang application that makes it easy to consume the
_changes api from erlang,
thought someone may find it useful.

brief usage:

1> % start the application
1> changes_client:start().

2> % install the event handler you've just written (can install multiple)
2> changes_client:add_handler(my_event_handler, Args).

3> % start consuming the feeds
3> changes_client:add_feeds([
		{{tag, feed_1}, {url, "http://.../_changes?feed=continuous"}},
		{{tag, feed_2}, {url, "http://..."}}
	]).

>From now on, each line of each feed will cause an execution of
my_event_handler:hadle_event({change, Tag, JsonData}, State).

That's about it.

http://github.com/mcaprari/couchdb_changes_client

It comes with minimal documentation and a working example where all changes are
dispatched to a queue using the stomp protocol.

All feedback is greately appreciated.

cheers.
-- 
:Matteo Caprari
matteo.caprari@gmail.com

Mime
View raw message