Skip to main content

async_websocket_client

Project description

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

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

websocket_client_asyncio-1.1.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file websocket_client_asyncio-1.1.3.tar.gz.

File metadata

File hashes

Hashes for websocket_client_asyncio-1.1.3.tar.gz
Algorithm Hash digest
SHA256 8e3ee6c9f98d467e32487102717f047141a36c1969130387a6141b9d8237ed7f
MD5 9885e4caccfcefdb88fadba624a875f3
BLAKE2b-256 e6a579c904c6a7db4c1a2d0fabc4a06727f894b9408a3d57ddaf18618fa5a026

See more details on using hashes here.

File details

Details for the file websocket_client_asyncio-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for websocket_client_asyncio-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7340f659c18bda12698bc0bbe3edf06d20201e4b19894a4a1db00b52a0e5bbd4
MD5 30475215705b76bfdba7f84f4f85c61c
BLAKE2b-256 8089e8baedf7fcd6ae4d72edc7063be772260e87b292d22555c2789f94e05a20

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page