I am creating a flask application, for one request I need to run some long running job which is not required to wait on the UI. I will create a thread and send a message to
The best thing to do for stuff like this is use a message broker. There is some excellent software in the python world meant for doing just this:
Both are excellent choices.
It's almost never a good idea to spawn a thread the way you're doing it, as this can cause issues processing incoming requests, among other things.
If you take a look at the celery or RQ getting started guides, they'll walk you through doing this the proper way!