[Twisted-Python] Reactors

James Y Knight foom at fuhm.net
Fri Nov 19 12:27:08 MST 2004


On Nov 18, 2004, at 6:29 PM, Bob Ippolito wrote:
> It also calls (or at least used to call) stopReading and stopWriting 
> immediately after a TCP client connection is made, and then calls 
> startReading and startWriting again.. which causes the wrapper to get 
> thrown away, so it might miss notifications in the meantime.

That shouldn't matter in a level-triggered system: it'll call back 
every time the socket is readable/writable, not just the first time. 
Thus, missing a notification because the user asked to not receive them 
for a while is okay.

> I think it already uses weakrefs, but I was never confident that they 
> would go away at the right time, and from recent python-dev threads, 
> it doesn't sound like it's a good thing to depend on at all any time 
> soon :)

I think all the problems were related to weakref objects being disposed 
of during GC. As long as all your weakrefs are strongly referenced from 
the module level, I believe they should be safe.

James





More information about the Twisted-Python mailing list