No project description provided
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
Подключение:
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
Close
Hashes for async_websocket_client-0.0.0a7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 054a89fa4f4d9fc7efd53be053afa8597cd16ec536029c8cfa20ce77f375f7ad |
|
MD5 | f5c08cda7e2fede495b7d1b2d4c271f4 |
|
BLAKE2b-256 | 5d6f0d3b3bb3ace027184aa35bda545990616d43d2514af8bd30c1eeee467ef8 |
Close
Hashes for async_websocket_client-0.0.0a7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51507279c1defb64a7d887fde9c0a503a24b718f3ec775012eaedc8c34daf6f4 |
|
MD5 | 9b1a44ce570f1256633ef4e16b652cdd |
|
BLAKE2b-256 | c63b85f3306f1109bdf345958210e5ac56d61bf84ef3a610145b665308d79504 |