Skip to content

Commit d668b6f

Browse files
committed
Add a comment
1 parent b6bccde commit d668b6f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/posthog/sender.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ defmodule PostHog.Sender do
9494

9595
@impl GenServer
9696
def handle_continue(:send_batch, state) do
97+
# Before we initiate an HTTP request that might block the process
98+
# for a potentially noticeable time, we signal to the outside world that this
99+
# sender is currently busy and if there is another sender available it
100+
# should be used instead.
97101
Registry.update_value(state.registry, registry_key(state.index), fn _ -> :busy end)
98102
PostHog.API.post_batch(state.api_client, state.events)
99103
Registry.update_value(state.registry, registry_key(state.index), fn _ -> :available end)

0 commit comments

Comments
 (0)