文件名称:wsaio:基于asyncio协议的事件驱动的Python WebSocket库
文件大小:13KB
文件格式:ZIP
更新时间:2024-04-29 05:00:11
Python
sai 基于Python的事件驱动的WebSocket库,它基于asyncio的协议构建。 import asyncio import itertools import wsaio URL = 'wss://echo.websocket.org' class HelloClient ( wsaio . WebSocketClient ): @ wsaio . taskify async def ws_connected ( self ): for i in itertools . count (): print ( f'[HelloClient] Sending data - COUNT: { i } ' ) await self . send_str ( 'Hello World' )
【文件预览】:
wsaio-master
----test.py(667B)
----LICENSE(10KB)
----setup.py(594B)
----README.md(768B)
----wsaio()
--------exceptions.py(386B)
--------websocket.py(8KB)
--------utils.py(101B)
--------http.py(6KB)
--------__init__.py(455B)
--------protocol.py(4KB)
--------client.py(5KB)
----.gitignore(37B)