When to suggest?

I have never written code that uses threads.

I have a web application that accepts a POST request and creates an image based on the data in the request body.

Do I want to disable the thread to create the image to prevent the server from freezing before creating the image? Is this a suitable use or just a solution looking for a problem?

Please correct any misconceptions I may have.

+5
source share
2 answers

The usual approach for handling HTTP requests synchronously is to create a new thread for each request (or reuse one in the pool) as soon as it appears.

python HTTP, - GIL - , , .

. , .

+2

, , , Celery, .

+3

All Articles