Module Expr Str Assign NameStore NameLoad ImportFrom alias Import alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str Assign NameStore TupleLoad NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr decorator_list Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr CompareLt BinOpSub NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore ListLoad FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad ListLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore ListLoad FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call SubscriptLoad NameLoad Index Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr decorator_list Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad decorator_list decorator_list Expr Call AttributeLoad Call NameLoad attr Call AttributeLoad NameLoad attr
N/A N/A 
Tests for implementations of L{IReactorThreads}.
 N/A __metaclass__ type weakref ref N/A gc threading twisted.python.threadable isInIOThread twisted.internet.test.reactormixins ReactorBuilder twisted.python.threadpool ThreadPool twisted.internet.interfaces IReactorThreads ThreadTestsBuilder N/A ReactorBuilder N/A N/A 
    Builder for defining tests relating to L{IReactorThreads}.
     N/A requiredInterfaces N/A IReactorThreads test_getThreadPool N/A N/A self N/A N/A N/A 
        C{reactor.getThreadPool()} returns an instance of L{ThreadPool} which
        starts when C{reactor.run()} is called and stops before it returns.
         N/A state N/A N/A reactor N/A N/A self buildReactor N/A pool N/A N/A reactor getThreadPool N/A N/A N/A self assertIsInstance pool ThreadPool N/A N/A N/A self assertFalse N/A pool started Pool should not start before reactor.run f N/A N/A N/A N/A N/A N/A N/A state append N/A pool started N/A N/A N/A state append N/A pool joined N/A N/A N/A reactor stop N/A N/A N/A N/A reactor callWhenRunning f N/A N/A N/A self runReactor reactor 2 N/A N/A N/A self assertTrue N/A state N/A 0 Pool should start after reactor.run N/A N/A N/A self assertFalse N/A state N/A 1 Pool should not be joined before reactor.stop N/A N/A N/A self assertTrue N/A pool joined Pool should be stopped after reactor.run returns N/A test_suggestThreadPoolSize N/A N/A self N/A N/A N/A 
        C{reactor.suggestThreadPoolSize()} sets the maximum size of the reactor
        threadpool.
         N/A reactor N/A N/A self buildReactor N/A N/A N/A reactor suggestThreadPoolSize 17 N/A pool N/A N/A reactor getThreadPool N/A N/A N/A self assertEqual N/A pool max 17 N/A test_delayedCallFromThread N/A N/A self N/A N/A N/A 
        A function scheduled with L{IReactorThreads.callFromThread} invoked
        from a delayed call is run immediately in the next reactor iteration.

        When invoked from the reactor thread, previous implementations of
        L{IReactorThreads.callFromThread} would skip the pipe/socket based wake
        up step, assuming the reactor would wake up on its own.  However, this
        resulted in the reactor not noticing a insert into the thread queue at
        the right time (in this case, after the thread queue has been processed
        for that reactor iteration).
         N/A reactor N/A N/A self buildReactor threadCall N/A N/A N/A N/A N/A N/A N/A reactor stop N/A N/A N/A N/A reactor callLater 0 N/A reactor callFromThread threadCall N/A before N/A N/A reactor seconds N/A N/A N/A self runReactor reactor 60 N/A after N/A N/A reactor seconds N/A N/A N/A self assertTrue N/A N/A after before 30 N/A test_callFromThread N/A N/A self N/A N/A N/A 
        A function scheduled with L{IReactorThreads.callFromThread} invoked
        from another thread is run in the reactor thread.
         N/A reactor N/A N/A self buildReactor N/A result N/A threadCall N/A N/A N/A N/A N/A N/A N/A result append N/A N/A threading currentThread N/A N/A N/A reactor stop N/A N/A N/A N/A reactor callLater 0 N/A reactor callInThread N/A reactor callFromThread threadCall N/A N/A N/A self runReactor reactor 5 N/A N/A N/A self assertEquals result N/A N/A N/A threading currentThread N/A test_stopThreadPool N/A N/A self N/A N/A N/A 
        When the reactor stops, L{ReactorBase._stopThreadPool} drops the
        reactor's direct reference to its internal threadpool and removes
        the associated startup and shutdown triggers.

        This is the case of the thread pool being created before the reactor
        is run.
         N/A reactor N/A N/A self buildReactor N/A threadpool N/A ref N/A N/A reactor getThreadPool N/A N/A N/A reactor callWhenRunning N/A reactor stop N/A N/A N/A self runReactor reactor N/A N/A N/A gc collect N/A N/A N/A self assertIdentical N/A threadpool None N/A test_stopThreadPoolWhenStartedAfterReactorRan N/A N/A self N/A N/A N/A 
        We must handle the case of shutting down the thread pool when it was
        started after the reactor was run in a special way.

        Some implementation background: The thread pool is started with
        callWhenRunning, which only returns a system trigger ID when it is
        invoked before the reactor is started.

        This is the case of the thread pool being created after the reactor
        is started.
         N/A reactor N/A N/A self buildReactor N/A threadPoolRefs N/A acquireThreadPool N/A N/A N/A N/A N/A N/A N/A threadPoolRefs append N/A ref N/A N/A reactor getThreadPool N/A N/A N/A reactor stop N/A N/A N/A N/A reactor callWhenRunning acquireThreadPool N/A N/A N/A self runReactor reactor N/A N/A N/A gc collect N/A N/A N/A self assertIdentical N/A N/A threadPoolRefs N/A 0 None N/A test_cleanUpThreadPoolEvenBeforeReactorIsRun N/A N/A self N/A N/A N/A 
        When the reactor has its shutdown event fired before it is run, the
        thread pool is completely destroyed.

        For what it's worth, the reason we support this behavior at all is
        because Trial does this.

        This is the case of the thread pool being created without the reactor
        being started at al.
         N/A reactor N/A N/A self buildReactor N/A threadPoolRef N/A ref N/A N/A reactor getThreadPool N/A N/A N/A reactor fireSystemEvent shutdown N/A N/A N/A gc collect N/A N/A N/A self assertIdentical N/A threadPoolRef None N/A test_isInIOThread N/A N/A self N/A N/A N/A 
        The reactor registers itself as the I/O thread when it runs so that
        L{twisted.python.threadable.isInIOThread} returns C{True} if it is
        called in the thread the reactor is running in.
         N/A results N/A N/A reactor N/A N/A self buildReactor check N/A N/A N/A N/A N/A N/A N/A results append N/A isInIOThread N/A N/A N/A reactor stop N/A N/A N/A N/A reactor callWhenRunning check N/A N/A N/A self runReactor reactor N/A N/A N/A self assertEqual N/A True results N/A test_isNotInIOThread N/A N/A self N/A N/A N/A 
        The reactor registers itself as the I/O thread when it runs so that
        L{twisted.python.threadable.isInIOThread} returns C{False} if it is
        called in a different thread than the reactor is running in.
         N/A results N/A N/A reactor N/A N/A self buildReactor check N/A N/A N/A N/A N/A N/A N/A results append N/A isInIOThread N/A N/A N/A reactor callFromThread N/A reactor stop N/A N/A N/A N/A reactor callInThread check N/A N/A N/A self runReactor reactor N/A N/A N/A self assertEqual N/A False results N/A N/A N/A N/A N/A N/A globals update N/A N/A ThreadTestsBuilder makeTestCaseClasses