[Web-SIG] [PEP 444] Future- and Generator-Based Async Idea
Alice Bevan–McGregor
alice at gothcandy.com
Sun Jan 9 14:29:34 CET 2011
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.
More information about the Web-SIG
mailing list