Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`internet`.`posixbase`.`_ContinuousPolling``

class documentation

`class _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 | `addReader` | Add a `FileDescriptor` for notification of data available to read.
Method | `addWriter` | Add a `FileDescriptor` for notification of data available to write.
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.
Method | `iterate` | Call `doRead` and `doWrite` on all readers and writers respectively.
Method | `removeAll` | Remove all readers and writers.
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 | `_checkLoop` | Start or stop a `LoopingCall` based on whether there are readers and writers.
Constant | `_POLL_DISCONNECTED` | Undocumented
Constant | `_POLL_IN` | Undocumented
Constant | `_POLL_OUT` | Undocumented
Instance Variable | `_loop` | A `LoopingCall` that drives the polling, or `None`.
Instance Variable | `_reactor` | The `EPollReactor` that is using this instance.
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.

Inherited from `_PollLikeMixin`:

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

Inherited from `_DisconnectSelectableMixin` (via `_PollLikeMixin`):

Method | `_disconnectSelectable` | Utility function for disconnecting a selectable.

def __init__(self, reactor): (source)

Undocumented

def addReader(self, reader): (source)
from `twisted.internet.interfaces.IReactorFDSet`

Add a `FileDescriptor` for notification of data available to read.

def addWriter(self, writer): (source)
from `twisted.internet.interfaces.IReactorFDSet`

Add a `FileDescriptor` for notification of data available to write.

def getReaders(self): (source)
from `twisted.internet.interfaces.IReactorFDSet`

Return a list of the readers.

def getWriters(self): (source)
from `twisted.internet.interfaces.IReactorFDSet`

Return a list of the writers.

def isReading(self, fd): (source)

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

Parameters
fd:`twisted.internet.abstract.FileDescriptor` | The file descriptor being checked.
Returns
`bool` | `True` if the file descriptor is being observed for read readiness, `False` otherwise.

def isWriting(self, fd): (source)

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

Parameters
fd:`twisted.internet.abstract.FileDescriptor` | The file descriptor being checked.
Returns
`bool` | `True` if the file descriptor is being observed for write readiness, `False` otherwise.

def iterate(self): (source)

Call `doRead` and `doWrite` on all readers and writers respectively.

def removeAll(self): (source)
from `twisted.internet.interfaces.IReactorFDSet`

Remove all readers and writers.

def removeReader(self, reader): (source)
from `twisted.internet.interfaces.IReactorFDSet`

Remove a `FileDescriptor` from notification of data available to read.

def removeWriter(self, writer): (source)
from `twisted.internet.interfaces.IReactorFDSet`

Remove a `FileDescriptor` from notification of data available to write.

def _checkLoop(self): (source)

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

_POLL_DISCONNECTED: `int` = (source)

Undocumented

Value

    1

_POLL_IN: `int` = (source)

Undocumented

Value

    2

_POLL_OUT: `int` = (source)

Undocumented

Value

    4

_loop = (source)

A `LoopingCall` that drives the polling, or `None`.

_reactor = (source)

The `EPollReactor` that is using this instance.

_readers: `set` = (source)

A `set` of `FileDescriptor` objects that should be read from.

_writers: `set` = (source)

A `set` of `FileDescriptor` objects that should be written to.