[Twisted-Python] reactor.callLater

ritchie turner ritchie at ipowerhouse.com
Mon Jul 14 22:15:05 MDT 2003


Thx, that works well.

R

Andrew Bennetts wrote:

>On Mon, Jul 14, 2003 at 07:02:55PM -0700, ritchie turner wrote:
>  
>
>>Hi All
>>
>>I"m a twisted newbie, and I'd like to know why reactor.callLater
>>doesn't seem to work when called from the Factory __init__ method,
>>but it does work if I call it from a regular protocol. I'm trying to set up
>>a broadcast to all protocalls and am using callLater to schedule a timed
>>broadcast.
>>    
>>
>
>In general, you should use startFactory for this, rather than __init__, to
>support persistence.  If you are using Twisted's plugin infrastructure
>(mktap and twistd), then __init__ will be called at mktap time, which is too
>early.  If you override the startFactory method instead, it should work --
>startFactory is called when the factory is started, rather than when it is
>created.
>
>[Hmm... perhaps mktap should do as trial does, and check that the reactor
>has no pending timed calls before exiting?  A warning about this sort of
>thing could be useful.]
>
>-Andrew.
>
>
>_______________________________________________
>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