ChannelBox it is a simple tool for Starlette framework that allows you to make named webscoket channels.
Project description
ChannelBox
ChannelBox it is a simple tool for Starlette framework that allows you send messages to named websocket channels.
Example of use:
- chats
- notifications from backend
- alerts
https://github.com/Sobolev5/channel-box
Install
To install run:
pip install channel-box
[important!] See full working example with websocket setup
https://channel-box.andrey-sobolev.ru/
https://github.com/Sobolev5/channel-box/tree/master/example
NGINX websocket setup
http://nginx.org/en/docs/http/websocket.html
Check uvicorn installation
pip install uvicorn[standard]
channel_box methods
Send message to any group from any part of your code:
await channel_box.channel_send("MySimpleChat", {"username": "another part code", "message": "hello from SendFromAnotherPartCode"}, show=True, history=True)
Show groups and channels:
await channel_box.channels_show()
Flush all groups and channels:
await channel_box.channels_flush()
Buy me a coffee [thanks]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for channel_box-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec37d5b785fb345f418cbb97bae252fcc49d1f44b30f82e33a01c2d6bbc1d311 |
|
MD5 | 846956515c48db02821847e872039401 |
|
BLAKE2b-256 | 12a5669d1d594bae4b8dc6a8d8969a3c8dc2eb636db87f6d6666b58e18fc2160 |