[Web-SIG] PEP 444 feature request - Futures executor

Timothy Farrell tfarrell at owassobible.org
Fri Jan 7 18:47:12 CET 2011


There has been much discussion about how to handle async in PEP 444 and that discussion centers around the use of futures.  However, I'm requesting that servers _optionally_ provide environ['wsgi.executor'] as a futures executor that applications can use for the purpose of doing something after the response is fully sent to the client.  This is feature request is designed to be concurrency methodology agnostic.

Some example use cases are:

- send an email that might block on a slow email server (Alice, I read what you said about Turbomail, but one product is not the solution to all situations)
- initiate a database vacuum
- clean a cache
- build a cache
- compile statistics

When serving pages of an application, these are all things that could be done after the response has been sent.  Ideally these things don't need to be done in a request thread and aren't incredibly time-sensitive.  It seems to me that futures would be an ideal way of handling this.

Thoughts?


More information about the Web-SIG mailing list