anchor.diff:      {stop, {error, any()}, atom(), state()} |
       {next_state, atom(), state()} |
       {next_state, atom(), state(), timeout()}.
  -receive_chunk({call, From}, Event, State) ->
  -    enqueue_work_or_stop(receive_chunk, Event, From, State);
  -receive_chunk(cast, {'DOWN', _, _, _, _Reason}, _State) ->
  +receive_chunk({call, From}, Event, StateData) ->
  +    enqueue_work_or_stop(receive_chunk, Event, From, StateData);
  +receive_chunk(cast, {'DOWN', _, _, _, _Reason}, _StateData) ->
       error(incomplete);
  -receive_chunk(cast, {gun_data, _Pid, StreamRef, IsFin, Data}, State) ->
  -    NewState = manage_chunk(IsFin, StreamRef, Data, State),
  +receive_chunk(cast, {gun_data, _Pid, StreamRef, IsFin, Data}, StateData) ->
  +    NewStateData = manage_chunk(IsFin, StreamRef, Data, StateData),
       case IsFin of
           fin ->
  -            {next_state, at_rest, NewState, 0};
  +            {next_state, at_rest, NewStateData, 0};
           nofin ->
  -            {next_state, receive_chunk, NewState}
  +            {next_state, receive_chunk, NewStateData}
       end;
  -receive_chunk(cast, {gun_error, _Pid, _StreamRef, _Reason}, State) ->
  -    {next_state, at_rest, State, 0};
  -receive_chunk(info, Event, State) ->
  -    handle_info(Event, receive_chunk, State).
  +receive_chunk(cast, {gun_error, _Pid, _StreamRef, _Reason}, StateData) ->
  +    {next_state, at_rest, StateData, 0};
  +receive_chunk(info, Event, StateData) ->
  +    handle_info(Event, receive_chunk, StateData).
   
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %% Private
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
   %% @private
  --spec clean_state() -> state().
  -clean_state() ->
  -    clean_state(#{}).
  -
  -%% @private
  --spec clean_state(map()) -> state().
  -clean_state(State) ->
  -    Responses = maps:get(responses, State, queue:new()),
  -    Requests  = maps:get(pending_requests, State, queue:new()),
  +-spec clean_state_data() -> state().
  +clean_state_data() ->
  +    clean_state_data(#{}).
  +
  +%% @private
  +-spec clean_state_data(map()) -> state().
  +clean_state_data(StateData) ->
  +    Responses = maps:get(responses, StateData, queue:new()),
  +    Requests  = maps:get(pending_requests, StateData, queue:new()),
       #{
          pid              => undefined,
          stream           => undefined,
  
positive.code: %% @private
  -spec manage_chunk(fin | nofin, reference(), binary(), state()) -> state().
  manage_chunk(IsFin, StreamRef, Data,
               State = #{handle_event := undefined,
                         responses := Responses,
                         async_mode := binary}) ->
      NewResponses = queue:in({IsFin, StreamRef, Data}, Responses),
      State#{responses => NewResponses};
  manage_chunk(IsFin, StreamRef, Data,
               State = #{handle_event := undefined,
                         responses := Responses,
                         async_mode := sse}) ->
      {Events, NewState} = sse_events(IsFin, Data, State),
      FunAdd = fun(Event, Acc) ->
                       queue:in({IsFin, StreamRef, Event}, Acc)
               end,
      NewResponses = lists:foldl(FunAdd, Responses, Events),
      NewState#{responses => NewResponses};
  manage_chunk(IsFin, StreamRef, Data,
               State = #{handle_event := HandleEvent,
                         async_mode := binary}) ->
      HandleEvent(IsFin, StreamRef, Data),
      State;
  manage_chunk(IsFin, StreamRef, Data,
               State = #{handle_event := HandleEvent,
                         async_mode := sse}) ->
      {Events, NewState} = sse_events(IsFin, Data, State),
      Fun = fun (Event) -> HandleEvent(IsFin, StreamRef, Event) end,
      lists:foreach(Fun, Events),
  
      NewState.
  
  %% @private
  -spec process_options(map(), headers(), http_verb()) -> map().
  
negative.code:     {next_state, atom(), state(), timeout()}.
  wait_response({call, From}
                , {data, Data, FinNoFin}
                , #{stream := StreamRef, pid := Pid} = StateData) ->
      ok = gun:data(Pid, StreamRef, FinNoFin, Data),
      gen_statem:reply(From, ok),
      {next_state, wait_response, StateData};
  wait_response({call, From}, Event, StateData) ->
      enqueue_work_or_stop(wait_response, Event, From, StateData);
  wait_response(cast, {'DOWN', _, _, _, Reason}, _StateData) ->
      exit(Reason);
  wait_response(cast, {gun_response, _Pid, _StreamRef, fin, StatusCode, Headers},
                #{from := From} = StateData) ->
      Response = #{status_code => StatusCode, headers => Headers},
      gen_statem:reply(From, {ok, Response}),
      {next_state, at_rest, StateData, 0};
  wait_response(cast, {gun_response, _Pid, _StreamRef, nofin, StatusCode, Headers},
                #{from := From, stream := StreamRef, async := Async} = StateData) ->
      StateName =
        case lists:keyfind(<<"transfer-encoding">>, 1, Headers) of
            {<<"transfer-encoding">>, <<"chunked">>} when Async ->
  