Skip to main content

No project description provided

Project description

WebSockets Groups

Модуль реализующих менеджер групп WebSocket подключений

PyPI PyPI - Python Version GitLab last commit

Test coverage Downloads GitLab stars

Functionality

  • Регистрация / Удаление WS
  • Создание / Удаление групп WS
  • Подключение WS в группу
  • Поддержка реестров: memory, redis

Quick start

Установка:

pip install websockets-groups

Подключение:

from fastapi import WebSocket
from websockets_groups import WSGroupsManager, MemoryStorage, BaseDispatcher

ws_groups_manager = WSGroupsManager(MemoryStorage())

class ChatDispatcher(BaseDispatcher):
    pass

@app.websocket('/chats/')
async def ws_view(webdocket: WebSocket, chat_name: str):
    await ws_groups_manager.register_ws(websocket, ChatDispatcher())

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

async_websocket_client-0.0.0a6.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

async_websocket_client-0.0.0a6-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

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