-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce (or provide user-facing warnings) instantiating the Python client as a singleton #152
Comments
@dmarticus just curious, it looks like you had a promising PR to this here: #151 |
Yeah, nothing fundamentally wrong, I just never finished it and then other priorities took over (this was a weekend hack job so it's not principled, even if the ideas were good). You're more than welcome to take it over and get it over the line :) |
I don't have full context sorry, so not sure if this is correct, buuut we already do have both modes of operation. If you want to enforce a singleton-like behaviour - you can use the non-instantiation method of using the client (see It's unclear to me how / when this issue occurs unless users are explicitly creating new clients? A bit reluctant to have yet another way to do things, specially when we don't really want to deprecate the current method (contra existing PR), because there are valid cases where you want to send different events to different instances, and the only good way to do that is to have separate clients. |
FYI, this was brought to discussion again today due to this ticket investigation: https://posthog.slack.com/archives/C0864Q9802Y/p1743098163480279 It's not exactly the same as the original thread, but the solution was to use |
Full context can be found here: https://posthog.slack.com/archives/C03P7NL6RMW/p1733514026622539, but here's the summary for external stakeholders:
Issue:
Root Cause:
Solution:
The text was updated successfully, but these errors were encountered: