anchor.diff:      erlang:send_after(5000, self(), {start_listener, Seq}),
       {noreply, NewSt#st{changes_pid=undefined}};
   handle_info({start_listener, Seq}, St) ->
  -    {NewPid, _} = spawn_monitor(fun() -> listen_for_changes(Seq) end),
  -    {noreply, St#st{changes_pid=NewPid}};
  +    {noreply, St#st{
  +        changes_pid = start_changes_listener(Seq)
  +    }};
   handle_info(restart_config_listener, State) ->
       ok = config:listen_for_changes(?MODULE, nil),
       {noreply, State};
  
positive.code:     couch_stats:increment_counter([mem3, shard_cache, hit]),
      cache_hit(DbName),
      {noreply, St};
  handle_cast({cache_insert, DbName, Shards}, St) ->
      couch_stats:increment_counter([mem3, shard_cache, miss]),
      {noreply, cache_free(cache_insert(St, DbName, Shards))};
  handle_cast({cache_remove, DbName}, St) ->
      couch_stats:increment_counter([mem3, shard_cache, eviction]),
      {noreply, cache_remove(St, DbName)};
  handle_cast(_Msg, St) ->
      {noreply, St}.
  
  
negative.code:                     [DbName, Reason]);
              {Doc} ->
                  Shards = mem3_util:build_ordered_shards(DbName, Doc),
                  Msg = {cache_insert_change, DbName, Shards, Seq},
                  gen_server:cast(?MODULE, Msg),
                  [create_if_missing(mem3:name(S)) || S
                      <- Shards, mem3:node(S) =:= node()]
              end
          end
      end,
      {ok, Seq};
  changes_callback(timeout, _) ->
      ok.
  
  