Class t.i.d.SelectReactor(posixbase.PosixReactorBase):

Part of twisted.internet.default View Source View In Hierarchy

Known subclasses: twisted.internet.gtk2reactor.PortableGtkReactor, twisted.internet.gtkreactor.PortableGtkReactor

Implements interfaces: twisted.internet.interfaces.IReactorFDSet

A select() based reactor - runs on all POSIX platforms and on Win32.
Instance Variables_readsA dictionary mapping FileDescriptor instances to arbitrary values (this is essentially a set). Keys in this dictionary will be checked for read events.
_writesA dictionary mapping FileDescriptor instances to arbitrary values (this is essentially a set). Keys in this dictionary will be checked for writability.

Split Table into Classes Show Methods in One Table

Line # Kind Name Docs
66 Method __init__ Initialize file descriptor tracking dictionaries and the base class.
93 Method doSelect Run one iteration of the I/O monitor loop.
158 Method addReader Add a FileDescriptor for notification of data available to read.
164 Method addWriter Add a FileDescriptor for notification of data available to write.
170 Method removeReader Remove a Selectable for notification of data available to read.
177 Method removeWriter Remove a Selectable for notification of data available to write.
184 Method removeAll Remove all readers and writers.
188 Method getReaders Return the list of file descriptors currently monitored for input
192 Method getWriters Return the list file descriptors currently monitored for output events
75 Method _preenDescriptors Undocumented
144 Method _doReadOrWrite Undocumented

Inherited from PosixReactorBase:

Line # Kind Name Docs
198 Method installWaker Install a `waker' to allow threads and signals to wake up the IO thread.
212 Method spawnProcess Spawn a process, with a process protocol.
243 Method listenUDP Connects a given DatagramProtocol to the given numeric UDP port.
252 Method connectUDP DEPRECATED.
266 Method listenMulticast Connects a given DatagramProtocol to the given numeric UDP port.
280 Method connectUNIX
307 Method listenUNIX
321 Method listenUNIXDatagram Connects a given DatagramProtocol to the given path.
336 Method connectUNIXDatagram Connects a ConnectedDatagramProtocol instance to a path.
352 Method listenTCP
359 Method connectTCP
368 Method connectSSL
376 Method listenSSL
385 Method listenWith Start an instance of the given portType listening.
391 Method connectWith Start an instance of the given connectorType connecting.
175 Method _disconnectSelectable Utility function for disconnecting a selectable.
289 Method _checkMode Check mode to see if a value was specified for it and emit a
397 Method _removeAll Remove all readers and writers, and return list of Selectables.

Inherited from _SignalReactorMixin (via PosixReactorBase):

Line # Kind Name Docs
1096 Method startRunning Extend the base implementation in order to remember whether signal
1126 Method run Undocumented
1131 Method mainLoop Undocumented
1055 Method _handleSignals Install the signal handlers for the Twisted event loop.
1079 Method _handleSigchld Reap all processes on SIGCHLD.
1110 Method _reallyStartRunning Extend the base implementation by also installing signal handlers, if

Inherited from ReactorBase (via PosixReactorBase):

Line # Kind Name Docs
456 Method installResolver Set the internal resolver to use to for name lookups.
462 Method wakeUp Wake up the event loop.
470 Method doIteration Do one iteration over the readers and writers which have been added.
508 Method resolve Return a Deferred that will resolve a hostname.
521 Method stop See twisted.internet.interfaces.IReactorCore.stop.
532 Method crash See twisted.internet.interfaces.IReactorCore.crash.
545 Method sigInt Handle a SIGINT interrupt.
551 Method sigBreak Handle a SIGBREAK interrupt.
557 Method sigTerm Handle a SIGTERM interrupt.
563 Method disconnectAll Disconnect every reader, and writer in the system.
573 Method iterate See twisted.internet.interfaces.IReactorCore.iterate.
580 Method fireSystemEvent See twisted.internet.interfaces.IReactorCore.fireSystemEvent.
588 Method addSystemEventTrigger See twisted.internet.interfaces.IReactorCore.addSystemEventTrigger.
598 Method removeSystemEventTrigger See twisted.internet.interfaces.IReactorCore.removeSystemEventTrigger.
605 Method callWhenRunning See twisted.internet.interfaces.IReactorCore.callWhenRunning.
614 Method startRunning Method called when reactor starts: do some initialization and fire
648 Method callLater See twisted.internet.interfaces.IReactorTime.callLater.
684 Method cancelCallLater See twisted.internet.interfaces.IReactorTime.cancelCallLater.
692 Method getDelayedCalls Return all the outstanding delayed calls in the system.
708 Method timeout Undocumented
718 Method runUntilCurrent Run all pending timed calls.
871 Method callFromThread 0 See twisted.internet.interfaces.IReactorThreads.callFromThread.
900 Method callInThread See twisted.internet.interfaces.IReactorThreads.callInThread.
908 Method suggestThreadPoolSize See twisted.internet.interfaces.IReactorThreads.suggestThreadPoolSize.
919 Method callFromThread Cause a function to be executed by the reactor thread.
637 Method _reallyStartRunning Method called to transition to the running state. This should happen
661 Method _moveCallLaterSooner Undocumented
681 Method _cancelCallLater Undocumented
699 Method _insertNewDelayedCalls Undocumented
783 Method _checkProcessArgs Check for valid arguments and environment to spawnProcess.
866 Method _initThreads Undocumented
882 Method _initThreadPool Create the threadpool accessible with callFromThread.
892 Method _stopThreadPool Stop the reactor threadpool.
Line # Kind Name Docs
66 Method __init__ Initialize file descriptor tracking dictionaries and the base class.
158 Method addReader Add a FileDescriptor for notification of data available to read.
588 Method addSystemEventTrigger See twisted.internet.interfaces.IReactorCore.addSystemEventTrigger.
164 Method addWriter Add a FileDescriptor for notification of data available to write.
919 Method callFromThread Cause a function to be executed by the reactor thread.
871 Method callFromThread 0 See twisted.internet.interfaces.IReactorThreads.callFromThread.
900 Method callInThread See twisted.internet.interfaces.IReactorThreads.callInThread.
648 Method callLater See twisted.internet.interfaces.IReactorTime.callLater.
605 Method callWhenRunning See twisted.internet.interfaces.IReactorCore.callWhenRunning.
684 Method cancelCallLater See twisted.internet.interfaces.IReactorTime.cancelCallLater.
368 Method connectSSL
359 Method connectTCP
252 Method connectUDP DEPRECATED.
280 Method connectUNIX
336 Method connectUNIXDatagram Connects a ConnectedDatagramProtocol instance to a path.
391 Method connectWith Start an instance of the given connectorType connecting.
532 Method crash See twisted.internet.interfaces.IReactorCore.crash.
563 Method disconnectAll Disconnect every reader, and writer in the system.
470 Method doIteration Do one iteration over the readers and writers which have been added.
93 Method doSelect Run one iteration of the I/O monitor loop.
580 Method fireSystemEvent See twisted.internet.interfaces.IReactorCore.fireSystemEvent.
692 Method getDelayedCalls Return all the outstanding delayed calls in the system.
188 Method getReaders Return the list of file descriptors currently monitored for input
192 Method getWriters Return the list file descriptors currently monitored for output events
456 Method installResolver Set the internal resolver to use to for name lookups.
198 Method installWaker Install a `waker' to allow threads and signals to wake up the IO thread.
573 Method iterate See twisted.internet.interfaces.IReactorCore.iterate.
266 Method listenMulticast Connects a given DatagramProtocol to the given numeric UDP port.
376 Method listenSSL
352 Method listenTCP
243 Method listenUDP Connects a given DatagramProtocol to the given numeric UDP port.
307 Method listenUNIX
321 Method listenUNIXDatagram Connects a given DatagramProtocol to the given path.
385 Method listenWith Start an instance of the given portType listening.
1131 Method mainLoop Undocumented
184 Method removeAll Remove all readers and writers.
170 Method removeReader Remove a Selectable for notification of data available to read.
598 Method removeSystemEventTrigger See twisted.internet.interfaces.IReactorCore.removeSystemEventTrigger.
177 Method removeWriter Remove a Selectable for notification of data available to write.
508 Method resolve Return a Deferred that will resolve a hostname.
1126 Method run Undocumented
718 Method runUntilCurrent Run all pending timed calls.
551 Method sigBreak Handle a SIGBREAK interrupt.
545 Method sigInt Handle a SIGINT interrupt.
557 Method sigTerm Handle a SIGTERM interrupt.
212 Method spawnProcess Spawn a process, with a process protocol.
1096 Method startRunning Extend the base implementation in order to remember whether signal
614 Method startRunning Method called when reactor starts: do some initialization and fire
521 Method stop See twisted.internet.interfaces.IReactorCore.stop.
908 Method suggestThreadPoolSize See twisted.internet.interfaces.IReactorThreads.suggestThreadPoolSize.
708 Method timeout Undocumented
462 Method wakeUp Wake up the event loop.
681 Method _cancelCallLater Undocumented
289 Method _checkMode Check mode to see if a value was specified for it and emit a
783 Method _checkProcessArgs Check for valid arguments and environment to spawnProcess.
175 Method _disconnectSelectable Utility function for disconnecting a selectable.
144 Method _doReadOrWrite Undocumented
1079 Method _handleSigchld Reap all processes on SIGCHLD.
1055 Method _handleSignals Install the signal handlers for the Twisted event loop.
882 Method _initThreadPool Create the threadpool accessible with callFromThread.
866 Method _initThreads Undocumented
699 Method _insertNewDelayedCalls Undocumented
661 Method _moveCallLaterSooner Undocumented
75 Method _preenDescriptors Undocumented
1110 Method _reallyStartRunning Extend the base implementation by also installing signal handlers, if
637 Method _reallyStartRunning Method called to transition to the running state. This should happen
397 Method _removeAll Remove all readers and writers, and return list of Selectables.
892 Method _stopThreadPool Stop the reactor threadpool.
def __init__(self): (source)
Initialize file descriptor tracking dictionaries and the base class.
def _preenDescriptors(self): (source)
Undocumented
def doSelect(self, timeout): (source)

Run one iteration of the I/O monitor loop.

This will run all selectables who had input or output readiness waiting for them.
def _doReadOrWrite(self, selectable, method, dict): (source)
Undocumented
def addReader(self, reader): (source)
Add a FileDescriptor for notification of data available to read.
def addWriter(self, writer): (source)
Add a FileDescriptor for notification of data available to write.
def removeReader(self, reader): (source)
Remove a Selectable for notification of data available to read.
def removeWriter(self, writer): (source)
Remove a Selectable for notification of data available to write.
def removeAll(self): (source)

Remove all readers and writers.

Should not remove reactor internal reactor connections (like a waker).
ReturnsA list of IReadDescriptor and IWriteDescriptor providers which were removed.
def getReaders(self): (source)
Return the list of file descriptors currently monitored for input events by the reactor.
Returnsthe list of file descriptors monitored for input events. (type: list of IReadDescriptor )
def getWriters(self): (source)
Return the list file descriptors currently monitored for output events by the reactor.
Returnsthe list of file descriptors monitored for output events. (type: list of IWriteDescriptor )
API Documentation for Twisted, generated by pydoctor at 2008-10-26 16:12:37.