On Wed, 5 Nov 2008 17:41:44 +1100, Andrew Bennetts <[EMAIL PROTECTED]> wrote:
Jean-Paul Calderone wrote:
On Wed, 5 Nov 2008 15:11:08 +1100, Andrew Bennetts <[EMAIL PROTECTED]> wrote:
[...]
Yes, it is a singleton. As
<http://twistedmatrix.com/projects/core/documentation/howto/reactor-basics.html>
says:
You can get to the reactor object using the following code:
from twisted.internet import reactor
The documentation could perhaps be clearer about this (that document implies,
but doesn't directly state, that there's only one reactor instance).
Although I don't see how it matters if it's a singleton or not. :) If it
weren't, you could just pass the reactor you were using to the thread that
needed to use it.
It matters just because it makes it clear that yes, “from twisted.internet
import reactor” really does Just Work, all the time.
Sure. But even if it didn't, you'd be alright.
Plus, parameterized reactor makes unit testing easier.
Jean-Paul
_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web