Re: [PEP 444] Future- and Generator-Based Async Idea

Alice Bevan–McGregor <alice-h+KYGxXtFYrqlBn2x/[email protected]>
Newsgroups gmane.comp.python.web
Message-ID <[email protected]>
Here's what I've mutated Alex Grönholm's minimal middleware example 
into: (see the change history for the evolution of this)

	https://gist.github.com/771398

A complete functional (as in function, not working ;) async-capable 
middleware layer (that does nothing) is 12 lines.  That, I think is a 
reasonable amount of boilerplate.  Also, no decorators needed.  It's 
quite readable, even the way I've compressed it.

The class-based version is basically identical, but with added comments 
explaining the assumptions this example makes and demonstrating where 
the acutal middleware code can be implemented for simple middleware.

	- Alice.


_______________________________________________
Web-SIG mailing list
[email protected]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.