On May 12, 2008, at 12:01 AM, Ionel Maries Cristian wrote:

My thinking is that the server *creates* the environ dictionary, so it can just keep a reference to it and update it as needed. Is middleware allowed to replace environ with another dict instance before passing it to the application? I wasn't aware that this was allowed, but if it is, then I see the problem.

The solution would probably be for the application to pass a mutable object (e.g. an empty list) to readable/writable that the server could set a timeout flag on.

How about a environ['x-wsgiorg.async'].timeout ? I do something like that in cogen.

Or environ['x-wsgiorg.async.timeout'] could be an object whose truth value can be toggled by the server, like an instance of the following:

  class MutaBool(object):
      def __init__(self):
          self.val = False
      def __nonzero__(self):
          return self.val

Then there's no need for the server to change environ after starting the app. I think that's probably the way to go.


Chris
_______________________________________________
Web-SIG mailing list
Web-SIG@python.org
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: 
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com

Reply via email to