anchor.diff:      {reply, State#state.active, State};
   
   handle_call(get_queue, _From, State) ->
  -    {reply, State#state.waiting, State};
  -
  -handle_call(get_backlog, _From, #state{active=A, waiting=W} = State) ->
  +    {reply, to_list(State#state.waiting), State};
  +
  +handle_call(get_backlog, _From, #state{active=A, waiting=WQ} = State) ->
       CA = lists:sum([C || #job{count=C} <- A, is_integer(C)]),
  -    CW = lists:sum([C || #job{count=C} <- W, is_integer(C)]),
  +    CW = lists:sum([C || #job{count=C} <- to_list(WQ), is_integer(C)]),
       {reply, CA+CW, State}.
   
   handle_cast({push, DbName, Node}, State) ->
  
positive.code: -spec next_replication([#job{}], [#job{}]) -> {#job{}, [#job{}]} | nil.
  next_replication(Active, Waiting) ->
      Fun = fun(#job{name=S, node=N}) -> is_running(S,N,Active) end,
      case lists:splitwith(Fun, Waiting) of
      {_, []} ->
          nil;
      {Running, [Job|Rest]} ->
          {Job, Running ++ Rest}
      end.
  
  is_running(DbName, Node, ActiveList) ->
  
negative.code:         twig:log(debug, "adding ~s -> ~p to mem3_sync queue", [DbName, Node]),
          State#state{
              dict = dict:store({DbName,Node}, ok, D),
              waiting = in(Job, WQ)
          }
      end.
  
  