INNER CODE UNIT · Python

connected

psevensas/DjangoChannelsGraphqlWs · channels_graphql_ws/client.py:87

    def connected(self) -> bool:
        """Indicate whether client is connected."""
        return self._is_connected

    async def connect_and_init(self) -> None:
        """Establish and initialize WebSocket GraphQL connection.

        1. Establish WebSocket connection.
        2. Initialize GraphQL connection.
        """
        await self._transport.connect()
        await self._transport.send({"type": "connection_init", "payload": ""})
        resp = await self._transport.receive()
        assert resp["type"] == "connection_ack", f"Unexpected response `{resp}`!"
        self._is_connected = True

    # Default value for `id`, because `None` is also a valid value.
    AUTO = object()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…