[Twisted-Python] Submitted for your consideration

Andrew Bennetts andrew-twisted at puzzling.org
Wed Jun 11 06:30:07 MDT 2003


On Wed, Jun 11, 2003 at 07:36:42AM -0400, Jp Calderone wrote:
>  
> +        # Disable the idle timeout, in case this request takes a long
> +        # time to finish generating output.
> +        if self.timeOut:
> +            self._savedTimeOut = self.setTimeout(None)

[...]

> +            else:
> +                if self._savedTimeOut:
> +                    self.setTimeout(self._savedTimeOut)

I wonder if this idiom would be simplified by having a .cancelTimeout
method, rather than overloading .setTimeout(None) to mean that?  

These snippets could then look like something like:

+        # Disable the idle timeout, in case this request takes a long
+        # time to finish generating output.
+        self.cancelTimeout()

and:

+            else:
+                self.setTimeout(self.timeOut)

Or perhaps I'm just in an overly fussy mood tonight :)

-Andrew.





More information about the Twisted-Python mailing list