Util for create websocket client(s) quickly
Project description
websockets-assistant
How to use it
from websockets_assistant import client, run, sleep
async def hello(ws):
await ws.send("hello")
await sleep(1)
await ws.send("websocket")
await sleep(0.1)
await ws.close()
# test 1
async def main():
await asyncio.gather(
client("wss://echo.websocket.org/", log, hello, True),
client("wss://echo.websocket.org/", log, hello, True),
client("wss://echo.websocket.org/", log, hello, True),
)
run(main)
# test 2
def main():
client("wss://echo.websocket.org/", log, hello, True),
client("wss://echo.websocket.org/", log, hello, True),
run(main)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file websockets-assistant-2.8.tar.gz.
File metadata
- Download URL: websockets-assistant-2.8.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8c5191a14c7ec79a052fd04b8a1ec5bcafb707074c83c37610ace56fd9c6190
|
|
| MD5 |
316450f91136d49c8d2d6b3d6afab7c6
|
|
| BLAKE2b-256 |
45de03bf23c3cb6b3178606401a3b1ec7ebafe927c6d5ec7b97010606c8f229a
|