root/trunk/twisted/internet/reactor.py

Revision 24262, 1.9 KB (checked in by exarkun, 2 years ago)

Merge twisted.internet.reactor-doc-1144

Author: exarkun
Reviewer: thijs
Fixes: #1144

Add a module docstring to twisted.internet.reactor so that pydoctor has something
to pick up and include on the page for that module. The docstring briefly explains
the reactor and points to the documentation for a number reactor interfaces.

Line 
1# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
2# See LICENSE for details.
3
4"""
5The reactor is the Twisted event loop within Twisted, the loop which drives
6applications using Twisted. The reactor provides APIs for networking,
7threading, dispatching events, and more.
8
9The default reactor is based on C{select(2)} and will be installed if this
10module is imported without another reactor being explicitly installed.
11Regardless of which reactor is installed, importing this module is the correct
12way to get a reference to it.
13
14New application code should prefer to pass and accept the reactor as a
15parameter where it is needed, rather than relying on being able to import this
16module to get a reference.  This simplifies unit testing and may make it easier
17to one day support multiple reactors (as a performance enhancement), though
18this is not currently possible.
19
20@see: L{IReactorCore<twisted.internet.interfaces.IReactorCore>}
21@see: L{IReactorTime<twisted.internet.interfaces.IReactorTime>}
22@see: L{IReactorProcess<twisted.internet.interfaces.IReactorProcess>}
23@see: L{IReactorTCP<twisted.internet.interfaces.IReactorTCP>}
24@see: L{IReactorSSL<twisted.internet.interfaces.IReactorSSL>}
25@see: L{IReactorUDP<twisted.internet.interfaces.IReactorUDP>}
26@see: L{IReactorMulticast<twisted.internet.interfaces.IReactorMulticast>}
27@see: L{IReactorUNIX<twisted.internet.interfaces.IReactorUNIX>}
28@see: L{IReactorUNIXDatagram<twisted.internet.interfaces.IReactorUNIXDatagram>}
29@see: L{IReactorFDSet<twisted.internet.interfaces.IReactorFDSet>}
30@see: L{IReactorThreads<twisted.internet.interfaces.IReactorThreads>}
31@see: L{IReactorArbitrary<twisted.internet.interfaces.IReactorArbitrary>}
32@see: L{IReactorPluggableResolver<twisted.internet.interfaces.IReactorPluggableResolver>}
33"""
34
35import sys
36del sys.modules['twisted.internet.reactor']
37from twisted.internet import selectreactor
38selectreactor.install()
Note: See TracBrowser for help on using the browser.