FastAPI microservice for chatting
Project description
Usage
- Set env variables for chat service
- Run
python run.pyon your server. Chat will be available on endpoint ws://host:port/chat
As soon as you start server there will be connection to redis.
Using chat's endpoint user subscribes to queue, receiving data from it.
Queue's message must be like:
{"sender_id": 1, "reciever_ids": [2, 3, 4]}, "message": {"id": 111}}
sender_id- required (all messages have sender)reciever_ids- non-required, can be empty list or this field can even not existmessage- non-required, object that will be sent to users
Env variables
CHAT_HOST- host for running uvicorn applicationCHAT_PORT- post for running uvicorn applicationCHAT_WORKERS- number of workers for uvicorn applicationCHAT_BROKER_HOST- host for redis to subscribe to the queueCHAT_BROKER_PORT- port for redis to subscribe to the queueCHAT_BROKER_DB- db for redis to subscribe to the queueCHAT_CHANNEL_NAME- queue's name to subscribe toCHAT_DJANGO_BASE_URL- base url of django's applicationCHAT_DJANGO_GET_USER_URL- django's endpoint to get current user's informationCHAT_DJANGO_TOKEN_TYPE- jwt token's startCHAT_DJANGO_USER_RESPONSE_ID_FIELD- field for getting user's id after request to CHAT_DJANGO_GET_USER_URL
written using python 3.9.6
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 Distribution
jellyfish-chat-0.0.3.tar.gz
(5.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jellyfish-chat-0.0.3.tar.gz.
File metadata
- Download URL: jellyfish-chat-0.0.3.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ffa0c0bcc0c008d9ccc76746856bfcb5678e11d25574c8a70b0e099912bca7a
|
|
| MD5 |
f23eb29e76536f7f2ca09239c9928f6c
|
|
| BLAKE2b-256 |
4cb6baba6a616c4fba656903919409183f91059560f7059439fa4d713c945f7f
|
File details
Details for the file jellyfish_chat-0.0.3-py3-none-any.whl.
File metadata
- Download URL: jellyfish_chat-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a80bc3c425794d33ba79e94bf9b3284091e7445a74281b443572f7bedf570afe
|
|
| MD5 |
6fdf89a4e3c02cc1147750ac87946e94
|
|
| BLAKE2b-256 |
ef7bc4f77f39cf582d78d0bf2e2a79a3b8bcf9dbe1efae799119ff40ebbafde9
|