anchor.diff:  handle_config_change(_, _, _, _, _) ->
       {ok, nil}.
   
  -iter_procs(Tab, Lang, Fun, Acc) when is_binary(Lang) ->
  -    iter_procs(Tab, binary_to_list(Lang), Fun, Acc);
  +iter_procs(Tab, Lang, Fun, Acc) when is_list(Lang) ->
  +    iter_procs(Tab, list_to_binary(Lang), Fun, Acc);
   iter_procs(Tab, Lang, Fun, Acc) ->
       Pattern = #proc{lang=Lang, client=nil, _='_'},
       MSpec = [{Pattern, [], ['$_']}],
  
positive.code:                             gen_server:cast(Pid, stop);
                          _ ->
                              ok
                      end;
                  _ ->
                      ok
              end;
          _ ->
              ok
      end,
      {noreply, State};
  handle_cast(reload_config, State) ->
  
negative.code:     Keys2 = [{D,R} || {D,R} <- Keys, D /= DDocId],
      % add ddoc to the proc
      {ok, Proc#proc{ddoc_keys=[DDocKey|Keys2]}}.
  
  maybe_spawn_proc(State, Client) ->
      #state{proc_counts=Counts, waiting=Waiting} = State,
      #client{lang=Lang} = Client,
      Limit = list_to_integer(config:get(
                  "query_server_config", "os_process_limit", "100")),
      case dict:find(Lang, Counts) of
      {ok, Limit} ->
          add_waiting_client(Waiting, Client),
          State;
      _ ->
          spawn_link(?MODULE, new_proc, [Client]),
          State#state{
              proc_counts=dict:update_counter(Lang, 1, Counts)
          }
      end.
  
  find_proc(State, Client, [Fun|FindFuns]) ->
      try iter_procs(State#state.tab, Client#client.lang, Fun, nil) of
      {not_found, _} ->
          find_proc(State, Client, FindFuns);
      {ok, Proc} ->
          {reply, {ok, Proc, State#state.config}, State}
      catch error:Reason ->
          ?LOG_ERROR("~p ~p ~p", [?MODULE, Reason, erlang:get_stacktrace()]),
          {reply, {error, Reason}, State}
      end;
  find_proc(State, Client, []) ->
      {noreply, maybe_spawn_proc(State, Client)}.
  