Opened 10 years ago

Last modified 10 years ago

#746 enhancement closed fixed (fixed)

Scheduleing Example Doesn't work as expected

Reported by: maethor Owned by:
Priority: low Milestone:
Component: Keywords:
Cc: hypatia, maethor Branch:
Author: Launchpad Bug:

Description


Change History (3)

comment:1 Changed 10 years ago by maethor

The task.LoopingCall example found here
http://twistedmatrix.com/documents/howto/time doesn't behave as expected (well,
from a newbie standpoint at anyway).

Seeing as no output is given in the example, it's impossible for a new user to
know exactly what to expect, but I would have thought that "a second has passed"
would be printed out every second (it's what the example implies to me at
least). Instead I get the following:

a second has passed
<Deferred at 0x9bef80>
>>>

And then nothing else. When run from a script it just prints a second has passed
and then quits. This happend on both Linux and Windows running Python 2.3.

Could the documentation be updated to show what the output is suppossed to be,
and assuming that printing "a second has passed" and then coming to complete
stop is the expected behaviour of the example, would it be possible to have an
example that does actually print out "a second has passed" every second?

comment:2 Changed 10 years ago by itamarst

You need to call reactor.run(). The howto in svn shows the examples using
reactor.run().

comment:3 Changed 3 years ago by <automation>

  • Owner hypatia deleted
Note: See TracTickets for help on using tickets.