class documentation

class twisted.internet.posixbase._ContinuousPolling(_PollLikeMixin, _DisconnectSelectableMixin): (source)

Implements interfaces: twisted.internet.interfaces.IReactorFDSet

View In Hierarchy

Schedule reads and writes based on the passage of time, rather than notification.

This is useful for supporting polling filesystem files, which epoll(7) does not support.

The implementation uses _PollLikeMixin, which is a bit hacky, but re-implementing and testing the relevant code yet again is unappealing.

Method __init__ Undocumented
Method iterate Call doRead and doWrite on all readers and writers respectively.
Method addReader Add a FileDescriptor for notification of data available to read.
Method addWriter Add a FileDescriptor for notification of data available to write.
Method removeReader Remove a FileDescriptor from notification of data available to read.
Method removeWriter Remove a FileDescriptor from notification of data available to write.
Method removeAll Remove all readers and writers.
Method getReaders Return a list of the readers.
Method getWriters Return a list of the writers.
Method isReading Checks if the file descriptor is currently being observed for read readiness.
Method isWriting Checks if the file descriptor is currently being observed for write readiness.
Instance Variable _reactor The EPollReactor that is using this instance.
Instance Variable _loop A LoopingCall that drives the polling, or None.
Instance Variable _readers A set of FileDescriptor objects that should be read from.
Instance Variable _writers A set of FileDescriptor objects that should be written to.
Class Variable _POLL_DISCONNECTED Undocumented
Class Variable _POLL_IN Undocumented
Class Variable _POLL_OUT Undocumented
Method _checkLoop Start or stop a LoopingCall based on whether there are readers and writers.

Inherited from _PollLikeMixin:

Method _doReadOrWrite fd is available for read or write, do the work and raise errors if necessary.

Inherited from _DisconnectSelectableMixin:

Method _disconnectSelectable Utility function for disconnecting a selectable.
_reactor = (source)
The EPollReactor that is using this instance.
_loop = (source)
A LoopingCall that drives the polling, or None.
_readers = (source)
A set of FileDescriptor objects that should be read from.
(type: set)
_writers = (source)
A set of FileDescriptor objects that should be written to.
(type: set)
_POLL_DISCONNECTED = (source)

Undocumented

(type: int)
_POLL_IN = (source)

Undocumented

(type: int)
_POLL_OUT = (source)

Undocumented

(type: int)
def __init__(self, reactor): (source)

Undocumented

def _checkLoop(self): (source)

Start or stop a LoopingCall based on whether there are readers and writers.

def iterate(self): (source)

Call doRead and doWrite on all readers and writers respectively.

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 FileDescriptor from notification of data available to read.

def removeWriter(self, writer): (source)

Remove a FileDescriptor from notification of data available to write.

def removeAll(self): (source)

Remove all readers and writers.

def getReaders(self): (source)

Return a list of the readers.

def getWriters(self): (source)

Return a list of the writers.

def isReading(self, fd): (source)

Checks if the file descriptor is currently being observed for read readiness.

ParametersfdThe file descriptor being checked. (type: twisted.internet.abstract.FileDescriptor)
ReturnsTrue if the file descriptor is being observed for read readiness, False otherwise. (type: bool)
def isWriting(self, fd): (source)

Checks if the file descriptor is currently being observed for write readiness.

ParametersfdThe file descriptor being checked. (type: twisted.internet.abstract.FileDescriptor)
ReturnsTrue if the file descriptor is being observed for write readiness, False otherwise. (type: bool)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.