Acquire a shared read lock. See :meth:`ReadWriteLock.acquire_read` for full semantics. :param timeout: maximum wait time in seconds; ``-1`` means block indefinitely :param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavail
(self, timeout: float = -1, *, blocking: bool = True)
| 102 | return await loop.run_in_executor(self._executor, functools.partial(func, *args, **kwargs)) |
| 103 | |
| 104 | async def acquire_read(self, timeout: float = -1, *, blocking: bool = True) -> AsyncAcquireReadWriteReturnProxy: |
| 105 | """ |
| 106 | Acquire a shared read lock. |
| 107 | |
| 108 | See :meth:`ReadWriteLock.acquire_read` for full semantics. |
| 109 | |
| 110 | :param timeout: maximum wait time in seconds; ``-1`` means block indefinitely |
| 111 | :param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable |
| 112 | |
| 113 | :returns: a proxy that can be used as an async context manager to release the lock |
| 114 | |
| 115 | :raises RuntimeError: if a write lock is already held on this instance |
| 116 | :raises Timeout: if the lock cannot be acquired within *timeout* seconds |
| 117 | |
| 118 | """ |
| 119 | await self._run(self._lock.acquire_read, timeout, blocking=blocking) |
| 120 | return AsyncAcquireReadWriteReturnProxy(lock=self) |
| 121 | |
| 122 | async def acquire_write(self, timeout: float = -1, *, blocking: bool = True) -> AsyncAcquireReadWriteReturnProxy: |
| 123 | """ |