Skip to content

Commit

Permalink
Allow ping (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpaquet authored Sep 30, 2024
1 parent 2bdcaad commit d7c5c29
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion load_test/lib/load_test/user/sse.ex
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ defmodule SseUser do
{:http, {_, :stream, msg}} ->
msg = String.trim(msg)
Logger.debug(fn -> "#{header(state)} Received message: #{inspect(msg)}" end)
check_message(state, msg, first_message)

if msg =~ "event: ping" do
wait_for_messages(state, request_id, [first_message | remaining_messages])
else
check_message(state, msg, first_message)
end

{:http, {_, :stream_start, headers}} ->
{~c"x-sse-server", server} = List.keyfind(headers, ~c"x-sse-server", 0)
Expand Down

0 comments on commit d7c5c29

Please sign in to comment.