[Twisted-Python] Twisted CallLater: Advanced Usage

Tommi Virtanen tv at twistedmatrix.com
Sun Jul 13 11:46:40 EDT 2003

On Sun, Jul 13, 2003 at 12:24:34PM -0000, Moshe Zadka wrote:
> Those of you who heard my talks, either at Europython or Strakt, probably
> remember me going on about how to use reactor.callLater(0,) to partition
> algorithms into bite-size chunks, that would not delay the main loop too
> much. This a topic which is interesting to me. I'm still waiting for glyph

	Nice subject. I'd call it "how to block just a little" ;)

> def os_path_walk(path, visit, arg):
>     d = defer.Deferred()
>     def walk(path):
>         files = os.listdir(path)
>         visit(arg, path, files)
>         for file in files:
>             yield None
>             if os.path.isdir(file):

	You want

              if os.path.isdir(os.path.join(path, file)):

:(){ :|:&};:

More information about the Twisted-Python mailing list