* git clone
* create a virtual environment
* pip install -r requirements.py
* create a .env file and store your REDIS_DB_NO, REDIS_PASSWORD(if any), REDIS_QUEUE_NAME
* now we are ready with basic setup.
-------------- Running Producer Code ( Inside virtual env) --------------
* uvicorn producer_app.main:app --reload
---------------------------------------------------
-------------- Running Consumer/Worker Code ( Inside virtual env) --------------
( If you want multiple workers then follow the below for each worker, open separate terminal and run below code )
* python -m consumer_app.worker
---------------------------------------------------
-------------- How to Test --------------
Open a fresh terminal and hit your fast API end point : /start-message-queue
* Run the following curl command in terminal
curl --location 'localhost:8000/start-message-queue' \
--header 'Content-Type: application/json' \
--data '{
"numberOfMessages": 3
}'
-----------------------------------------
-
Notifications
You must be signed in to change notification settings - Fork 0
anon-000/fast-api-with-redis
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
Repository files navigation
About
Handling distributed queues with Redis 🗿
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published