anchor.diff:  %% @equiv list_buckets(Pid, default_timeout(list_buckets_timeout))
   -spec list_buckets(pid()) -> {ok, [bucket()]} | {error, term()}.
   list_buckets(Pid) ->
  -    list_buckets(Pid, default_timeout(list_buckets_timeout)).
  +    list_buckets(Pid, []).
   
   %% @doc List all buckets on the server specifying server-side timeout.
   %% <em>This is a potentially expensive operation and should not be used in production.</em>
  -%% @equiv list_buckets(Pid, Timeout, default_timeout(list_buckets_call_timeout))
  --spec list_buckets(pid(), timeout()) -> {ok, [bucket()]} | {error, term()}.
  -list_buckets(Pid, Timeout) ->
  -    list_buckets(Pid, Timeout, default_timeout(list_buckets_call_timeout)).
  -
  -%% @doc List all buckets on the server specifying server-side and local
  -%%      call timeout.
  -%% <em>This is a potentially expensive operation and should not be used in production.</em>
  --spec list_buckets(pid(), timeout(), timeout()) -> {ok, [bucket()]} |
  +-spec list_buckets(pid(), timeout()|list()) -> {ok, [bucket()]} |
                                                      {error, term()}.
  -list_buckets(Pid, Timeout, CallTimeout) ->
  -    gen_server:call(Pid, {req, rpblistbucketsreq, Timeout}, CallTimeout).
  +list_buckets(Pid, Timeout) when is_integer(Timeout) ->
  +    list_buckets(Pid, [{timeout, Timeout}]);
  +list_buckets(Pid, Options) ->
  +    case stream_list_buckets(Pid, Options) of
  +        {ok, ReqId} ->
  +            wait_for_list(ReqId);
  +        Error ->
  +            Error
  +    end.
  +
  +stream_list_buckets(Pid) ->
  +    stream_list_buckets(Pid, []).
  +
  +stream_list_buckets(Pid, Timeout) when is_integer(Timeout) ->
  +    stream_list_buckets(Pid, [{timeout, Timeout}]);
  +stream_list_buckets(Pid, Options) ->
  +    ServerTimeout = 
  +        case proplists:get_value(timeout, Options, none) of
  +            none -> ?DEFAULT_TIMEOUT;
  +            ST -> ST
  +        end,
  +    ReqId = mk_reqid(),
  +    gen_server:call(Pid, {req, #rpblistbucketsreq{timeout=ServerTimeout},
  +                          infinity, {ReqId, self()}}, infinity).
   
   %% @doc List all keys in a bucket
   %% <em>This is a potentially expensive operation and should not be used in production.</em>
   %% @equiv list_keys(Pid, Bucket, default_timeout(list_keys_timeout))
   -spec list_keys(pid(), bucket()) -> {ok, [key()]} | {error, term()}.
   list_keys(Pid, Bucket) ->
  -    list_keys(Pid, Bucket, default_timeout(list_keys_timeout)).
  +    list_keys(Pid, Bucket, []).
   
   %% @doc List all keys in a bucket specifying timeout. This is
   %% implemented using {@link stream_list_keys/3} and then waiting for
   %% the results to complete streaming.
   %% <em>This is a potentially expensive operation and should not be used in production.</em>
  --spec list_keys(pid(), bucket(), timeout()) -> {ok, [key()]} | {error, term()}.
  -list_keys(Pid, Bucket, Timeout) ->
  -    case stream_list_keys(Pid, Bucket, Timeout) of
  +-spec list_keys(pid(), bucket(), list()|timeout()) -> {ok, [key()]} | 
  +                                                      {error, term()}.
  +list_keys(Pid, Bucket, Timeout) when is_integer(Timeout) ->
  +    list_keys(Pid, Bucket, [{timeout, Timeout}]);
  +list_keys(Pid, Bucket, Options) ->
  +    case stream_list_keys(Pid, Bucket, Options) of
           {ok, ReqId} ->
  -            wait_for_listkeys(ReqId, Timeout);
  +            wait_for_list(ReqId);
           Error ->
               Error
       end.
  
positive.code:     %% server just returned the rpbdelresp code - no message was encoded
      {reply, ok, State};
  
  process_response(#request{msg = rpblistbucketsreq},
                   #rpblistbucketsresp{buckets = Buckets}, State) ->
      {reply, {ok, Buckets}, State};
  
  process_response(#request{msg = rpblistbucketsreq},
                   rpblistbucketsresp, State) ->
      %% empty buckets generate an empty message
      {reply, {ok, []}, State};
  
  process_response(#request{msg = #rpblistkeysreq{}}=Request,
                   #rpblistkeysresp{done = Done, keys = Keys}, State) ->
  
negative.code: %% @equiv stream_list_keys(Pid, Bucket, default_timeout(stream_list_keys_timeout))
  -spec stream_list_keys(pid(), bucket()) -> {ok, req_id()} | {error, term()}.
  stream_list_keys(Pid, Bucket) ->
      stream_list_keys(Pid, Bucket, []).
  
  %% @doc Stream list of keys in the bucket to the calling process specifying server side
  %%      timeout.
  