[Twisted-Python] reactor.callLater(0,) should not be an idiom [PATCH]

Bruce Mitchener bruce at cubik.org
Tue Oct 15 07:33:12 MDT 2002


Moshe Zadka wrote:
> This patch touches many places, so I wanted to run it by the list
> first.

I have no real opinion on whether or not something is wrong with the 
idea of a callLater(0, ...), but:

Could it be utils.schedule() or some other complete word rather than 
'sched'?

And the following part of your diff contains an obvious error:

> diff -ur -x CVS Twisted.clean/twisted/web/woven/template.py Twisted/twisted/web/woven/template.py
> --- Twisted.clean/twisted/web/woven/template.py	Wed Oct  9 13:37:41 2002
> +++ Twisted/twisted/web/woven/template.py	Tue Oct 15 07:02:49 2002
> @@ -77,7 +77,7 @@
>  
>  from twisted.internet import defer
>  from twisted.python import failure
> -from twisted.internet import reactor, defer
> +from twisted.internet import reactor, defer, utils
>  from twisted.python import log
>  
>  from twisted.web.server import NOT_DONE_YET
> @@ -195,7 +195,7 @@
>                  raise AttributeError, "%s does not define self.templateFile to operate on" % self.__class__
>              self.d = self.lookupTemplate(request)
>          # Schedule processing of the document for later...
> -        reactor.callLater(0, self.handleDocument, request, self.d)
> +        utils.sched(0, self.handleDocument, request, self.d)
>          #self.handleNode(request, self.d)
>          #return str(self.d.toxml())

  - Bruce





More information about the Twisted-Python mailing list