anchor.diff:          C when C > 0 ->
               deliver_queue_items(Max, Q)
           end
  -    end.
  +    end;
  +
  +handle_call(item_count, _From, Q) ->
  +    {reply, Q#q.items, Q};
  +
  +handle_call(size, _From, Q) ->
  +    {reply, Q#q.size, Q}.
   
   
   deliver_queue_items(Max, Q) ->
  
positive.code: -include("couch_db.hrl").
  
  % public API
  -export([new/1, queue/2, dequeue/1, dequeue/2, close/1]).
  
  % gen_server callbacks
  -export([init/1, terminate/2]).
  
negative.code: dequeue(Wq, MaxItems) ->
      try
          gen_server:call(Wq, {dequeue, MaxItems}, infinity)
      catch
          _:_ -> closed
      end.
  
  
  item_count(Wq) ->
      try
          gen_server:call(Wq, item_count, infinity)
      catch
          _:_ -> closed
      end.
  
  
  size(Wq) ->
      try
          gen_server:call(Wq, size, infinity)
      catch
          _:_ -> closed
      end.
  