anchor.diff:  
           PurgedIdxState = case purge_index(Db, Mod, IdxState) of
               {ok, IdxState0} -> IdxState0;
  -            reset -> exit(reset)
  +            reset -> exit({reset, self()})
           end,
   
           NumChanges = couch_db:count_changes_since(Db, CurrSeq),
  
positive.code:     {stop, unknown_cast, State}.
  
  
  handle_info({'EXIT', Pid, {updated, IdxState}}, #st{mod=Mod, pid=Pid}=State) ->
      Args = [Mod:get(db_name, IdxState), Mod:get(idx_name, IdxState)],
      ?LOG_INFO("Index update finished for db: ~s idx: ~s", Args),
      ok = gen_server:cast(State#st.idx, {updated, IdxState}),
      {noreply, State#st{pid=undefined}};
  handle_info({'EXIT', Pid, reset}, #st{idx=Idx, pid=Pid}=State) ->
      {ok, NewIdxState} = gen_server:call(State#st.idx, reset),
      Pid2 = spawn_link(fun() -> update(Idx, State#st.mod, NewIdxState) end),
      {noreply, State#st{pid=Pid2}};
  
negative.code:         end,
  
          {ok, FinalIdxState} = Mod:finish_update(LastIdxSt),
          exit({updated, self(), FinalIdxState})
      end).
  
  
  