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

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

Inherited from FilesystemLock:

Instance Variable name The name of the file associated with 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.
Method lock Acquire this lock.
Method unlock Release this lock.
_scheduler =
The object in charge of scheduling retries. In this implementation this is parameterized for testing.
_interval =
The retry interval for an IReactorTime based scheduler.
_tryLockCall =
A DelayedCall based on _interval that will manage the next retry for acquiring the lock.
_timeoutCall =
A DelayedCall based on deferUntilLocked's timeout argument. This is in charge of timing out our attempt to acquire the lock.
def __init__(self, name, scheduler=None):
ParametersnameThe name of the lock to acquire
schedulerAn object which provides IReactorTime
def deferUntilLocked(self, timeout=None):

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

Parameterstimeoutthe number of seconds after which to time out if the lock has not been acquired. (type: float or int)
Returnsa 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.
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.