Set () blocks request processing in Django?

In Django, if a view uses the sleep () function when responding to a request, does this block the processing of the entire request queue?

If so, how do I defer an HTTP response without this blocking behavior? Can we do this out of the box and avoid using a job queue like Celeri?

+4
source share
1 answer

It seems to me that a call to sleep() should block the execution of all Django code in most cases. However, this may depend on the deployment architecture (e.g. gevent, gunicorn, etc.). For example, if you use a server that runs Django threads for each request, then it will not block all code.

In most cases, using something like Celeri would be a much better solution because (1) did not reinvent the wheel and (2) it was tested.

+2
source

Source: https://habr.com/ru/post/1441356/


All Articles