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`.`task`.`Clock``

class documentation

`class Clock: (source)`

Known subclasses: `twisted.internet.testing.MemoryReactorClock`

Implements interfaces: `twisted.internet.interfaces.IReactorTime`

View In Hierarchy

Provide a deterministic, easily-controlled implementation of `IReactorTime.callLater`. This is commonly useful for writing deterministic unit tests for code which schedules events using this API.

Method | `__init__` | Undocumented
Method | `advance` | Move time on this clock forward by the given amount and run whatever pending calls should be run.
Method | `callLater` | See `twisted.internet.interfaces.IReactorTime.callLater`.
Method | `getDelayedCalls` | See `twisted.internet.interfaces.IReactorTime.getDelayedCalls`
Method | `pump` | Advance incrementally by the given set of times.
Method | `seconds` | Pretend to be time.time(). This is used internally when an operation such as `IDelayedCall.reset` needs to determine a time value relative to the current time.
Class Variable | `rightNow` | Undocumented
Instance Variable | `calls` | Undocumented
Method | `_sortCalls` | Sort the pending calls according to the time they are scheduled.

def __init__(self): (source)
overridden in `twisted.internet.testing.MemoryReactorClock`

Undocumented

def advance(self, amount: `float`): (source)

Move time on this clock forward by the given amount and run whatever pending calls should be run.

Parameters
amount:`float` | The number of seconds which to advance this clock's time.

def callLater(self, delay: `float`, callable: `Callable[..., object]`, *args: `object`, **kw: `object`) -> `IDelayedCall`: (source)
from `twisted.internet.interfaces.IReactorTime`

See `twisted.internet.interfaces.IReactorTime.callLater`.

def getDelayedCalls(self) -> `Sequence[IDelayedCall]`: (source)
from `twisted.internet.interfaces.IReactorTime`

See `twisted.internet.interfaces.IReactorTime.getDelayedCalls`

def pump(self, timings: `Iterable[float]`): (source)

Advance incrementally by the given set of times.

def seconds(self) -> `float`: (source)
from `twisted.internet.interfaces.IReactorTime`

Pretend to be time.time(). This is used internally when an operation such as `IDelayedCall.reset` needs to determine a time value relative to the current time.

Returns
`float` | The time which should be considered the current time.

rightNow: `float` = (source)

Undocumented

calls: `List[DelayedCall]` = (source)

Undocumented

def _sortCalls(self): (source)

Sort the pending calls according to the time they are scheduled.