Skip to content

Commit

Permalink
io
Browse files Browse the repository at this point in the history
  • Loading branch information
vkatsuba committed Oct 19, 2021
1 parent 3c10658 commit 5b63a9a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions big_tests/tests/rest_client_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1026,14 +1026,14 @@ connect_to_sse(User) ->
#{pid => ConnPid, stream_ref => StreamRef}.

wait_for_event(#{pid := Pid, stream_ref := StreamRef} = Opts) ->
case gun:await(Pid, StreamRef) of
{response, nofin, _, _} ->
case gun:await(Pid, StreamRef, 5000) of
{response, nofin, _, _} = A -> io:format("await_1 ~p~n", [A]),
wait_for_event(Opts);
{data, nofin, _} ->
{data, nofin, _} = A -> io:format("await_2 ~p~n", [A]),
wait_for_event(Opts);
{sse, #{data := [Response]}} ->
{sse, #{data := [Response]}} = A -> io:format("await_3 ~p~n", [A]),
Opts#{data => Response};
Error ->
Error -> io:format("await_error ~p~n", [Error]),
Error
end.

Expand Down

0 comments on commit 5b63a9a

Please sign in to comment.