disconnect_websocket
Close the WebSocket connection and clean up the manager thread.
Signature
def disconnect_websocket(self) -> NoneExample
from dango.info import Info
from dango.utils.constants import MAINNET_API_URL
info = Info(MAINNET_API_URL)
# ... subscribe and process events ...
info.disconnect_websocket()Notes
- Signals the manager to stop, calls
ws.close(), and joins the thread with a 5-second timeout. - After disconnect, a subsequent
subscribe_*call rebuilds a freshWebsocketManagerand re-opens the socket. - Safe to call when no manager was ever constructed (e.g. if you only used HTTP queries).
See also
unsubscribe— drop a single subscriptionWebsocketManager— the underlying transport