You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/02/13 01:01:22 UTC
[09/12] couch-index commit: updated refs/heads/1994-merge-rcouch to
7c1666b
couch_mrview: couch_mrview_changes:handle_changes
Similar to couch_changes:handle_changes but for view changes. It add
support for longpolling, normal and continuous stream The API differs
from the one for doc by beeing independant from the transport: the
support of HTTP will be added on top for example.
This API will be also used to replace the view filter in the current _changes
API.
Also add unittests.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/commit/c1e96031
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/tree/c1e96031
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/diff/c1e96031
Branch: refs/heads/1994-merge-rcouch
Commit: c1e960318253d51de74cadab7d049858e8d4ec8c
Parents: e77ec75
Author: benoitc <be...@apache.org>
Authored: Fri Jan 31 13:13:23 2014 +0100
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Wed Feb 12 17:58:22 2014 -0600
----------------------------------------------------------------------
src/couch_index_server.erl | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/blob/c1e96031/src/couch_index_server.erl
----------------------------------------------------------------------
diff --git a/src/couch_index_server.erl b/src/couch_index_server.erl
index 86791db..facde14 100644
--- a/src/couch_index_server.erl
+++ b/src/couch_index_server.erl
@@ -159,6 +159,8 @@ reset_indexes(DbName, Root) ->
MRef = erlang:monitor(process, Pid),
gen_server:cast(Pid, delete),
receive {'DOWN', MRef, _, _, _} -> ok end,
+ couch_index_event:notify({index_delete,
+ {DbName, DDocId, couch_mrview_index}}),
rem_from_ets(DbName, Sig, DDocId, Pid)
end,
lists:foreach(Fun, ets:lookup(?BY_DB, DbName)),
@@ -193,6 +195,11 @@ update_notify({ddoc_updated, {DbName, DDocId}}) ->
fun({_DbName, {_DDocId, Sig}}) ->
case ets:lookup(?BY_SIG, {DbName, Sig}) of
[{_, IndexPid}] ->
+ %% notify to event listeners that the index has been
+ %% updated
+ couch_index_event:notify({index_update,
+ {DbName, DDocId,
+ couch_mrview_index}}),
(catch gen_server:cast(IndexPid, ddoc_updated));
[] ->
ok