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
Metadata
Release files for async-websocket-client 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| async_websocket_client-0.1.0.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| async_websocket_client-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.9 kB
Release files / async_websocket_client-0.1.0.tar.gz
| Download URL | async_websocket_client-0.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7bfce4b42328e35604a692eff80e000e96a05facacfb4b7b051f0b654237eb9
|
|
BLAKE2b-256 checksum How to use checksums |
a2b71125e4a937b7a8aaf2b9ad09c58810660f4812afa88c323646d64bb4d776
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.8.16 Linux/5.15.0-73-generic
|
Release files / async_websocket_client-0.1.0-py3-none-any.whl
| Download URL | async_websocket_client-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1219d707df5c403542f37ca4784ca375f8c8ad62b06d81ccdb250dfe96568bbf
|
|
BLAKE2b-256 checksum How to use checksums |
9f2cc52519f3a461f745169cdcb0914710a73fa0c519676da0a02d3d89554d87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.8.16 Linux/5.15.0-73-generic
|