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

unsubscribe

Drop a subscription locally and tell the server to stop streaming.

Signature

def unsubscribe(self, subscription_id: int) -> bool

Example

from dango.websocket_manager import WebsocketManager
 
manager = WebsocketManager("https://api-mainnet.dango.zone")
manager.start()
sid = manager.subscribe(document, variables, print)
 
# ... later ...
manager.unsubscribe(sid)

Parameters

subscription_idint. The id returned by a previous subscribe call.

Returns

boolTrue if the subscription was registered. False if the id was unknown. The complete frame to the server is best-effort — sending failures are swallowed (the server will drop the subscription anyway when the connection eventually closes).

See also

  • subscribe — register a subscription
  • stop — close the whole connection