anchor.diff:  teach_any_proc(_, _, []) ->
       {error, noproc}.
   
  -teach_ddoc(DDoc, {DDocId, _Rev}=DDocKey, #proc{ddoc_keys=Keys}=Proc) ->
  +teach_ddoc(DDoc, {DDocId, _Rev}=DDocKey, #proc_int{ddoc_keys=Keys}=Proc) ->
       % send ddoc over the wire
       % we only share the rev with the client we know to update code
       % but it only keeps the latest copy, per each ddoc, around.
  -    true = couch_query_servers:proc_prompt(Proc, [<<"ddoc">>, <<"new">>,
  -        DDocId, couch_doc:to_json_obj(DDoc, [])]),
  +    true = couch_query_servers:proc_prompt(
  +        export_proc(Proc),
  +        [<<"ddoc">>, <<"new">>, DDocId, couch_doc:to_json_obj(DDoc, [])]),
       % we should remove any other ddocs keys for this docid
       % because the query server overwrites without the rev
       Keys2 = [{D,R} || {D,R} <- Keys, D /= DDocId],
  
positive.code:                 maybe_spawn_proc(State, Client)
          end
      end.
  
  maybe_spawn_proc(State, Client) ->
      #state{proc_counts=Counts, waiting=Waiting} = State,
  
negative.code:     unlink(Pid),
      {ok, Proc}.
  
  assign_proc(Tab, ClientPid, #proc_int{client=nil}=Proc0) when is_pid(ClientPid) ->
      Proc = Proc0#proc_int{client = erlang:monitor(process, ClientPid)},
      ets:insert(Tab, Proc),
      export_proc(Proc);
  assign_proc(Tab, #client{}=Client, #proc_int{client=nil}=Proc) ->
      {Pid, _} = Client#client.from,
      assign_proc(Tab, Pid, Proc).
  
  return_proc(#state{} = State, #proc{} = Proc) ->
      case ets:lookup(State#state.tab, Proc#proc.pid) of
          [#proc_int{}=ProcInt] ->
              return_proc(State, ProcInt);
          [] ->
              % Proc must've died and we already
              % cleared it out of the table in
              % the handle_info clause.
              ok
      end;
  return_proc(#state{} = State, #proc_int{} = ProcInt) ->
      #state{tab = Tab, waiting = Waiting} = State,
      #proc_int{pid = Pid, lang = Lang} = ProcInt,
      case is_process_alive(Pid) of true ->
          case get_waiting_client(Waiting, Lang) of
              nil ->
                  gen_server:cast(Pid, garbage_collect),
                  ets:insert(Tab, ProcInt#proc_int{client=nil}),
                  State;
              #client{}=Client ->
                  From = Client#client.from,
                  assign_proc(Tab, Client, ProcInt#proc_int{client=nil}),
                  gen_server:reply(From, {ok, ProcInt, State#state.config}),
                  State
          end;
      false ->
  