async_websocket_client
Project description
Async WebSocket client
A module that implements an asynchronous interface based on websockets for working with websockets
Functionality
- Регистрация / Удаление WS
- Создание / Удаление групп WS
- Подключение WS в группу
- Поддержка реестров: memory, redis
Quick start
Установка:
pip install async-websocket-client
update version thinks author
- aioretry , lost connect auto retry
Подключение:
import asyncio
from async_websocket_client.apps import AsyncWebSocketApp
from async_websocket_client.dispatchers import BaseDispatcher
class SomeDispatcher(BaseDispatcher):
async def on_connect(self):
return await self.ws.send('hello, server')
async def on_message(self, message: str):
return await self.ws.send(f'server, I received your message. len(message)=={len(message)}')
client = AsyncWebSocketApp('ws://localhost:8001/ws', SomeDispatcher())
client.asyncio_run() # quick run
# or
asyncio.run(client.run()) # Run with asyncio
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file websocket_client_asyncio-1.1.3.tar.gz
.
File metadata
- Download URL: websocket_client_asyncio-1.1.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e3ee6c9f98d467e32487102717f047141a36c1969130387a6141b9d8237ed7f |
|
MD5 | 9885e4caccfcefdb88fadba624a875f3 |
|
BLAKE2b-256 | e6a579c904c6a7db4c1a2d0fabc4a06727f894b9408a3d57ddaf18618fa5a026 |
File details
Details for the file websocket_client_asyncio-1.1.3-py3-none-any.whl
.
File metadata
- Download URL: websocket_client_asyncio-1.1.3-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7340f659c18bda12698bc0bbe3edf06d20201e4b19894a4a1db00b52a0e5bbd4 |
|
MD5 | 30475215705b76bfdba7f84f4f85c61c |
|
BLAKE2b-256 | 8089e8baedf7fcd6ae4d72edc7063be772260e87b292d22555c2789f94e05a20 |