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

Sean Riley sean at twistedmatrix.com
Tue Oct 15 09:55:44 MDT 2002


i agree. please call it something complete.

why move it to "utils."? it seems inconsistent to have reactor.callLater and
utils.schedule.. shouldn't they both be on the same module?

-----Original Message-----
From: twisted-python-admin at twistedmatrix.com
[mailto:twisted-python-admin at twistedmatrix.com]On Behalf Of Bruce
Mitchener
Sent: Tuesday, October 15, 2002 8:33 AM
To: twisted-python at twistedmatrix.com
Subject: Re: [Twisted-Python] reactor.callLater(0,) should not be an
idiom[PATCH]


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


_______________________________________________
Twisted-Python mailing list
Twisted-Python at twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python





More information about the Twisted-Python mailing list