Metadata-Version: 2.1
Name: async-websocket-client
Version: 0.0.0a6
Summary: 
Author: irocshers
Author-email: develop.iam@rocshers.com
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: websockets (>=11.0.2,<12.0.0)
Description-Content-Type: text/markdown

# WebSockets Groups

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

[![PyPI](https://img.shields.io/pypi/v/async-websocket-client)](https://pypi.org/project/async-websocket-client/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/async-websocket-client)](https://pypi.org/project/async-websocket-client/)
[![GitLab last commit](https://img.shields.io/gitlab/last-commit/rocshers/python/async-websocket-client)](https://gitlab.com/rocshers/python/async-websocket-client)

[![Test coverage](https://codecov.io/gitlab/rocshers:python/async-websocket-client/branch/release/graph/badge.svg?token=RPFNZ8SBQ6)](https://codecov.io/gitlab/rocshers:python/async-websocket-client)
[![Downloads](https://static.pepy.tech/badge/async-websocket-client)](https://pepy.tech/project/async-websocket-client)
[![GitLab stars](https://img.shields.io/gitlab/stars/rocshers/python/async-websocket-client)](https://gitlab.com/rocshers/python/async-websocket-client)

## Functionality

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

## Quick start

Установка:

```sh
pip install websockets-groups
```

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

```python
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())
```

