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
In example python code, we should be using explicit contexts for subtensor instances to avoid connection/memory leaks from leaving these instances open.
Subtensor must be initialized either with keyword with to create a cope, or explicitly closed with close()
If you don't do this correctly, it leaves the websocket open. we do attempt to close the websocket upon garbage collection, but because it's threaded, this is unreliable (see: python-websockets/websockets#1601 (comment))
You don't need to use the context manager and .close() — just one or the other. This is fine:
In example python code, we should be using explicit contexts for subtensor instances to avoid connection/memory leaks from leaving these instances open.
Subtensor must be initialized either with keyword with to create a cope, or explicitly closed with close()
If you don't do this correctly, it leaves the websocket open. we do attempt to close the websocket upon garbage collection, but because it's threaded, this is unreliable (see: python-websockets/websockets#1601 (comment))
You don't need to use the context manager and .close() — just one or the other. This is fine:
@thewhaleking for review
This is also fine, though uglier:
This is not fine:
With async, it's the same. This is fine:
or
or the uglier:
The text was updated successfully, but these errors were encountered: