Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

disconnect_websocket

Close the WebSocket connection and clean up the manager thread.

Signature

def disconnect_websocket(self) -> None

Example

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 fresh WebsocketManager and re-opens the socket.
  • Safe to call when no manager was ever constructed (e.g. if you only used HTTP queries).

See also