You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the Python client requires you to call initialize explicitly. We should get rid of this and ensure that the client is usable, as described in the documentation.
What needs to be done to complete this task?
Fix the behavior to work as described in the documentation
Ensure that creating a new client and running ping immediately works
The text was updated successfully, but these errors were encountered:
Previously, the client required explicit calls to initialize() and close() to manage the connection lifecycle. This put the responsibility on the user to ensure proper setup and teardown, increasing the risk of mismanagement, especially in the presence of exceptions.
Insight
Managing resources manually is error-prone and not aligned with modern asynchronous Python best practices. Python provides built-in support for context managers (async with) that can ensure safe and automatic setup and teardown of resources — even when exceptions occur.
Consequence
The initialize() and close() methods have been removed.
Instead, the client now implements the asynchronous context manager protocol (__aenter__ and __aexit__), which automates connection handling.
Usage now requires wrapping the client in an async with block:
Uh oh!
There was an error while loading. Please reload this page.
What is this task about?
Right now, the Python client requires you to call
initialize
explicitly. We should get rid of this and ensure that the client is usable, as described in the documentation.What needs to be done to complete this task?
ping
immediately worksThe text was updated successfully, but these errors were encountered: