In my setup(s) I often have:
web -> nginx -> uwsgi -> django -> backend api
Any of these can time out.
I use the requests library for calls to the backend api,
if this times out it throws a exception which if unhandled gets passed up the chain as a 500 error.
While the backend request is running, django blocks,
but uwsgi has multiple django instances started so other requests can be handled.
If I'd use a queue depends strongly on the specific purpose of the request.
... and on how long the requests will take. Will it likely time out, i. e. do you do something long-running?
And if the client needs just "got it working on it" as a response
or actual response data.
E.g. for handling financial data -- where the request has to be processed, and processed exactly once -- I'd use a queue.
With checking for duplicate requests, failed requests, ability to retry and so on.
Other extreme, if it's something like "Make me a PDF of this" I'll just pass execptions right back to the browser
and inform the human to please press this button again.
>
>
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/20152777-2847-4b94-974c-27be70ee04can%40googlegroups.com.
--
Michael Ross <
g...@ross.cx>