Skip to main content

Async WebSocket client

A module that implements an asynchronous interface based on websockets for working with websockets

PyPI PyPI - Python Version GitLab last commit

Test coverage Downloads GitLab stars

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

Metadata

Release files for websocket-client-asyncio 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for websocket-client-asyncio 1.1.3
File Size Uploaded
websocket_client_asyncio-1.1.3.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for websocket-client-asyncio 1.1.3
File Interpreter ABI Platform
websocket_client_asyncio-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / websocket_client_asyncio-1.1.3.tar.gz

Download URL websocket_client_asyncio-1.1.3.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8e3ee6c9f98d467e32487102717f047141a36c1969130387a6141b9d8237ed7f
BLAKE2b-256 checksum
How to use checksums
e6a579c904c6a7db4c1a2d0fabc4a06727f894b9408a3d57ddaf18618fa5a026
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.1

Release files / websocket_client_asyncio-1.1.3-py3-none-any.whl

Download URL websocket_client_asyncio-1.1.3-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7340f659c18bda12698bc0bbe3edf06d20201e4b19894a4a1db00b52a0e5bbd4
BLAKE2b-256 checksum
How to use checksums
8089e8baedf7fcd6ae4d72edc7063be772260e87b292d22555c2789f94e05a20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.1

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page