Permalink
Browse files

`_changes` is now supporting view index updatei events

if the _view filters is passed in the url, the request process subscribe
to the index updates using the new `couch_mrview_events:subscribe/3`
function. All events are then returned to the HTTP api.

Ex:

    $ curl
'http://localhost:5984/testdb/_changes?filter=_view&view=test/test&feed=eventsource&heartbeat=true'
    data:
{"seq":1,"id":"330c284b190e1af436eab034040007cf","changes":[{"rev":"1-ea7a185b492abc69a6c8e0358d244a98"}]}
    id: 1

    data:
{"seq":4,"id":"330c284b190e1af436eab03404001904","changes":[{"rev":"1-e930be0936bead4354f6a20203e9a9dc"}]}
    id: 4

    data:
{"seq":6,"id":"9ec518da154ddc28420682144e000844","changes":[{"rev":"1-2fa51075d2e9812eaaabf98ababfdd3a"}]}
    id: 6
  • Loading branch information...
1 parent 74c933d commit 64ba09f465ce67e0c597a78a7f7f10ce5b5385ae @benoitc benoitc committed Jun 21, 2012
Showing with 224 additions and 78 deletions.
  1. +2 −0 apps/couch_changes/include/couch_changes.hrl
  2. +222 −78 apps/couch_changes/src/couch_changes.erl
@@ -21,6 +21,8 @@
filter = "",
filter_fun,
filter_args = [],
+ filter_view,
+ view_args = [],
include_docs = false,
fields = [],
conflicts = false,
Oops, something went wrong.

0 comments on commit 64ba09f

Please sign in to comment.