We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6bccde commit d668b6fCopy full SHA for d668b6f
lib/posthog/sender.ex
@@ -94,6 +94,10 @@ defmodule PostHog.Sender do
94
95
@impl GenServer
96
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.
101
Registry.update_value(state.registry, registry_key(state.index), fn _ -> :busy end)
102
PostHog.API.post_batch(state.api_client, state.events)
103
Registry.update_value(state.registry, registry_key(state.index), fn _ -> :available end)
0 commit comments