Thursday, November 29, 2018

What is meant by blocking request in django?

Once I worked on a feature that use API like sending emails from my app, I write the code inside the django app.
My superior told me that causes request to block, so another request will be blocked until the process of calling the API finished and response sent to user.
He suggest that this process better off offloaded to celery.

I thought this can be solved by using multiple worker as in gunicorn, so another client can be served by another worker if there's available.
but, both he and I don't have a clue if above (solved by creating multiple worker) is true.

so, does it mean by blocking, it only blocks a single process/worker? or do all worker have to wait?
and what is another possible blocking request scenario? generating pdf? long calculation?

in addition, where can I read about blocking request in django? I searched but, really hard to find one 

This message and any attachments may contain confidential information and are intended only for the use of the intended recipient(s). Any disclosure, distribution or copying of this message and any attachments is strictly prohibited without approval from PT. Wisanamitra Argakarya. If you are not the intended recipient, you should notify the sender and delete this message immediately. PT. Wisanamitra Argakarya is not liable for any damage caused by any virus or malicious file transmitted by this message. Any views, opinions, or commitments expressed in this message do not necessarily reflect the views of PT. Wisanamitra Argakarya.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5fe5627f-a6ae-476e-a863-2389289e9802%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment