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
- Unzip the Redis server zip file.
- Run the redis-server.exe file.
- pip install -r requirements.txt
- python server.py
- celery -A server.celery worker -n worker1 (Assumes only one worker)
- All 3 of the points (2,4,5) should be working and running simultaneously.
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"}
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).
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"}.