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`.`defer`.`DeferredFilesystemLock``

class documentation

`class DeferredFilesystemLock(lockfile.FilesystemLock): (source)`

View In Hierarchy

A `FilesystemLock` that allows for a `Deferred` to be fired when the lock is acquired.

Method | `__init__` | No summary
Method | `deferUntilLocked` | Wait until we acquire this lock. This method is not safe for concurrent use.
Instance Variable | `_interval` | The retry interval for an `IReactorTime` based scheduler.
Instance Variable | `_scheduler` | The object in charge of scheduling retries. In this implementation this is parameterized for testing.
Instance Variable | `_timeoutCall` | An `IDelayedCall` based on `deferUntilLocked`'s timeout argument. This is in charge of timing out our attempt to acquire the lock.
Instance Variable | `_tryLockCall` | An `IDelayedCall` based on `_interval` that will manage the next retry for acquiring the lock.

Inherited from `FilesystemLock`:

Method | `lock` | Acquire this lock.
Method | `unlock` | Release this lock.
Instance Variable | `clean` | Indicates whether this lock was released cleanly by its last owner. Only meaningful after `lock` has been called and returns True.
Instance Variable | `locked` | Indicates whether the lock is currently held by this object.
Instance Variable | `name` | The name of the file associated with this lock.

def __init__(self, name, scheduler=None): (source)
overrides `twisted.python.lockfile.FilesystemLock.__init__`

Parameters
name:`str` | The name of the lock to acquire
scheduler:`Optional[IReactorTime]` | An object which provides `IReactorTime`

def deferUntilLocked(self, timeout=None): (source)

Wait until we acquire this lock. This method is not safe for concurrent use.

Parameters
timeout:`Optional[float]` | the number of seconds after which to time out if the lock has not been acquired.
Returns
`Deferred[None]` | a `Deferred` which will callback when the lock is acquired, or errback with a `TimeoutError` after timing out or an `AlreadyTryingToLockError` if the `deferUntilLocked` has already been called and not successfully locked the file.

_interval: `int` = (source)

The retry interval for an `IReactorTime` based scheduler.

_scheduler = (source)

The object in charge of scheduling retries. In this implementation this is parameterized for testing.

_timeoutCall: `Optional[IDelayedCall]` = (source)

An `IDelayedCall` based on `deferUntilLocked`'s timeout argument. This is in charge of timing out our attempt to acquire the lock.

_tryLockCall: `Optional[IDelayedCall]` = (source)

An `IDelayedCall` based on `_interval` that will manage the next retry for acquiring the lock.