anchor.diff:  %% internal functions
   %% ====================================================================
   
  +%% @private
  +%% Parse options
  +parse_options([], State) ->
  +    State;
  +parse_options([queue_if_disconnected|Options], State) ->
  +    parse_options(Options, State#state{queue_if_disconnected = true}).
  +
   maybe_reply({reply, Reply, State}) ->
       Request = State#state.active,
       NewRequest = send_caller(Reply, Request),
  
positive.code: %%      across the cluster.
  %%      See the map/reduce documentation for explanation of behavior.
  mapred_bucket(Pid, Bucket, Query, Timeout) ->
      {ok, ReqId} = mapred_bucket_stream(Pid, Bucket, Query, self(), Timeout),
      wait_for_mapred(ReqId, Timeout).
  
  %% @spec mapred_bucket_stream(Pid :: pid(),
  %%                            Bucket :: bucket(),
  
negative.code:     %% Start with an unlikely port number
      {ok, Pid} = start({127,0,0,1}, 65535),
      ?assertEqual({false, [{econnrefused,1}]}, is_connected(Pid)),
      ?assertEqual({error, disconnected}, ping(Pid)),
      ?assertEqual({error, disconnected}, list_keys(Pid, <<"b">>)),
      stop(Pid).
  
  queue_disconnected_test() ->
      %% Start with an unlikely port number
      {ok, Pid} = start({127,0,0,1}, 65535, [queue_if_disconnected]),
      ?assertEqual({error, timeout}, ping(Pid, 10)),    
      ?assertEqual({error, timeout}, list_keys(Pid, <<"b">>, 10)),
      stop(Pid).
  
  server_closes_socket_test() ->
      %% Set up a dummy socket to send requests on
      {ok, Listen} = gen_tcp:listen(0, [binary, {packet, 4}, {active, false}]),
      {ok, Port} = inet:port(Listen),
      {ok, Pid} = start_link("127.0.0.1", Port),
      {ok, Sock} = gen_tcp:accept(Listen),
      ?assertMatch(true, is_connected(Pid)),
  
      %% Send a ping request in another process so the test doesn't block
      Self = self(),
      spawn(fun() -> Self ! ping(Pid, infinity) end),
  
      %% Make sure request received then close the socket
      {ok, _ReqMsg} = gen_tcp:recv(Sock, 0),
      ok = gen_tcp:close(Sock),
      ok = gen_tcp:close(Listen),
      receive
          Msg ->
              ?assertEqual({error, disconnected}, Msg)
      end,
      %% Server will not have had a chance to reconnect yet, reason counters empty.
      ?assertMatch({false, []}, is_connected(Pid)),
      stop(Pid).
  
  pb_socket_test_() ->
  