I am creating an angular 2 app with python Flask as back end. Flask is only being used as a REST API. I use celery in the backend for tasks that take a lot of time.
One of the requirements I have now is that I need to download a large file from the angular app as it is being created in the back end. When a user makes the request... flask starts a celery job which calls a command line application in linux which creates the file .... but I don't want to wait till the whole file is created for the download to start .. I want the download to start as the file is being created. How can I achieve this in my current angular -> Flask REST API -> Celery setup?
It is different than the question here Create and download a CSV file from a Flask view
because:
- The file is being created by an external program ... not python
- The answer to the question is a "blocking" ... My files are large .. the python app should not hang till the download is complete