class documentation

class AutoLock(AsyncTaskMixin):

Constructor: AutoLock(lock, break_lock, interval)

View In Hierarchy

Mechanism that automatically locks given RemoteLock instance.

Will try to lock again after the RemoteLock is lost of any reason (i.e. connection lost, kicked by user with higher priority).

Method __init__ Create a new AutoLock instance.
Async Method lock Block until we own our RemoteLock.
Async Method on_locking_user_changed Schedule lock task because the lock changed.
Instance Variable logger Undocumented
Async Method _lock_once Undocumented
Instance Variable _break_lock Undocumented
Instance Variable _interval Undocumented
Instance Variable _lock Undocumented
def __init__(self, lock: RemoteLock, *, break_lock: bool = False, interval: float = 1.0):

Create a new AutoLock instance.

Parameters
lock:RemoteLockThe RemoteLock instance to automatically lock.
break_lock:boolWhether to use RemoteLock.break_lock() instead of RemoteLock.init_lock().
interval:floatHow many seconds between two consecutive lock attempts.
async def lock(self, *, blocking: bool = True):

Block until we own our RemoteLock.

async def on_locking_user_changed(self, _lock: RemoteLock, username: str):

Schedule lock task because the lock changed.

logger =

Undocumented

async def _lock_once(self):

Undocumented

_break_lock: bool =

Undocumented

_interval: float =

Undocumented

_lock: RemoteLock =

Undocumented