4 ms·
> Django's event system lets you avoid polling the DB. Django's signal system must be run on the same instance, synchronously, before returning any response to
by est 13y ago
> Django's event system lets you avoid polling the DB.
Django's signal system must be run on the same instance, synchronously, before returning any response to client. This means if a signal blocks, the response will never reach the client.
It's technically impossible to handle post-response events in WSGI.
http://dirtsimple.org/2011/07/wsgi-is-dead-long-live-wsgi-lite.html http://dirtsimple.org/2011/07/wsgi-is-dead-long-live-wsgi-li...
For example, user requests a blog post, you can't first return response then increase your view counter by 1. You just can't. Unless you use some container specific hooks (like uWSGI, Tornado, etc.)
- natrius 13y agoDjango's signals API is synchronous, but writing a wrapper to process signals as asynchronous tasks is relatively straightforward. https://github.com/nyergler/async-signals https://github.com/nyergler/async-signals