Best Flask open-source libraries and packages

Celery_Background_Task_Runner

Run's specific user based tasks for time interval defined by the user.
Updated 5 years ago

Celery_Background_Task_Runner

Run's specific user based tasks for time interval defined by the user. The REST application uses Celery for running Python tasks in the background. For example if the user wants to run a job for 300 seconds he can submit a POST request with time in headers.

Basic application stack - Flask, Python 2.7
OS : Windows 10
Tested using Postman

Running on a Windows system

  1. Unzip the Redis server zip file.
  2. Run the redis-server.exe file.
  3. pip install -r requirements.txt
  4. python server.py
  5. celery -A server.celery worker -n worker1 (Assumes only one worker)
  6. All 3 of the points (2,4,5) should be working and running simultaneously.

Exposes a GET API as "api/request?connId=19&timeout=80&quot"

This API will keep the request running for provided time on the server side. After the successful completion of the provided time it should return {"status":"ok"}

Exposes a GET API as "api/serverStatus"

This API returns all the running requests on the server with their time left for completion. E.g {"2":"15","8":"10"} where 2 and 8 are the connIds and 15 and 10 is the time remaining for the requests to complete (in seconds).

Exposes a PUT API as "api/kill" with payload as {"connId":12}

This API will finish the running request with provided connId, so that the finished request returns {"status":"killed"} and the current request will return {"status":"ok"}.