Feb-03-2023, 03:46 PM
I am trying to call a flask rest api to do some processing, but the processing is taking longer than the rest api timeout (2 minutes), and I have no control over the timeout value (shared hosting).
Is there any python functionality that I can use to perform a fire-and-forget type function call, i.e. get the rest api code to call a function to do the processing in the background, but return from the rest api call immediately (I don't need a response), so as not to hit the timeout, and allow other rest api calls to continue being processed?
Note: Celery/RabbitMQ/Redis, etc, is not an option.
Is there any python functionality that I can use to perform a fire-and-forget type function call, i.e. get the rest api code to call a function to do the processing in the background, but return from the rest api call immediately (I don't need a response), so as not to hit the timeout, and allow other rest api calls to continue being processed?
Note: Celery/RabbitMQ/Redis, etc, is not an option.