anchor.diff:      enqueue_work_or_stop(wait_response, Event, From, State).
   
   %% @private
  --spec receive_data(term(), pid(), term()) -> term().
  +-spec receive_data(term(), pid(), term()) ->
  +    {stop, {error, any()}, atom(), state()} |
  +    {next_state, atom(), state(), timeout()}.
   receive_data(Event, From, State) ->
       enqueue_work_or_stop(receive_data, Event, From, State).
   
   %% @private
  --spec receive_chunk(term(), pid(), term()) -> term().
  +-spec receive_chunk(term(), pid(), term()) ->
  +    {stop, {error, any()}, atom(), state()} |
  +    {next_state, atom(), state(), timeout()}.
   receive_chunk(Event, From, State) ->
       enqueue_work_or_stop(receive_chunk, Event, From, State).
   
  
positive.code: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  %% @private
  -spec clean_state() -> map().
  clean_state() ->
      clean_state(#{}).
  
  %% @private
  -spec clean_state(map()) -> map(); (queue:queue()) -> map().
  clean_state(State) ->
      Responses = maps:get(responses, State, queue:new()),
      Requests  = maps:get(pending_requests, State, queue:new()),
  
negative.code:     end.
  
  %% @private
  -type ascii_string() :: [1..255].
  
  -spec encode_basic_auth(ascii_string(), ascii_string()) -> binary().
  encode_basic_auth(Username, Password) ->
      base64:encode(Username ++ [$: | Password]).
  
  