Django_website_video.mp4
Notes: This is the updated version, all the back-end jobs are compressed to the Huey worker, all of which will be executed by this worker when it recieves the POST request
- Requests made by the users: When the users make the request to the webserver, it will be forward to the
urls.pyof Django framework - Mapping endpoint with the views function:
Views functionsare Django's back-end functions, normally used to perform certain users-defined logic to response to the request coming from the users- Regarding the certain structure, the
Views functionsare mainly used to retrieve the parameters sent by the users, which in this case are thestart_date,end_date,seller_id, and finally thelauncher
- View function perform according actions:
- After receving the users' parameters, the view function will forward these paramaters to the
Huey Task Queue Manager- The
Huey Task Queue Manageris built to run asynchronously, meaning that this process will happen besides the main thread, allowing the views function to continue with its logic - Thanks to this feature, the view function is able to
redirectthe users back to the home page, otherwise, the page will continue loading until the task executed by the worker is done
- The
- After passing these params to the
Huey Task Queue Manager, the views function can continue redirecting the users to the home page asynchronously
- After receving the users' parameters, the view function will forward these paramaters to the
Huey Task Queue Managerputs the parameters with the assigned task toRedis Message Broker:- Normally,
Redisis used as the cache database for the back-end, but in this case, it's used as theMessage Broker, mostly used to store the queued tasks - Thanks to
Redis, this will allow upcoming tasks not going to be missed, but rather stored onRedisand wait for idle workers (if any) to pick them up and execute the task
- Normally,
Huey Workerlistens onRedisto pick up any upcoming tasks to execute:- Since we have the
Huey Workerconnected to theRedisserver through the set up, it has been running in the back-end background - when the task arrived, it will be informed and pick up the task from
Redisto execute
- Since we have the
