FastAPI microservice for chatting
Project description
Usage
- Set env variables for chat service
- Run
python run.py
on 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.2b0.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for jellyfish_chat-0.0.2b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f1a41716699baa296ec9af6b85ac18606dbc722e76636b088e526fffd600d33 |
|
MD5 | 0013f9e52a64ad9aedff1b4a4fad0daa |
|
BLAKE2b-256 | fb6421fa8016d1267a66a0c92af8189bbbffc0c974cef15935f2822dc0feb690 |