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)
| 167 | raise |
| 168 | |
| 169 | async def acquire_read(self, timeout: float = -1, *, blocking: bool = True) -> AsyncAcquireReadWriteReturnProxy: |
| 170 | """ |
| 171 | Acquire a shared read lock. |
| 172 | |
| 173 | See :meth:`ReadWriteLock.acquire_read` for full semantics. |
| 174 | |
| 175 | :param timeout: maximum wait time in seconds; ``-1`` means block indefinitely |
| 176 | :param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable |
| 177 | |
| 178 | :returns: a proxy that can be used as an async context manager to release the lock |
| 179 | |
| 180 | :raises RuntimeError: if a write lock is already held on this instance |
| 181 | :raises Timeout: if the lock cannot be acquired within *timeout* seconds |
| 182 | |
| 183 | """ |
| 184 | self._raise_if_unusable() |
| 185 | await self._run_acquire(functools.partial(self._lock.acquire_read, timeout, blocking=blocking)) |
| 186 | return AsyncAcquireReadWriteReturnProxy(lock=self) |
| 187 | |
| 188 | async def acquire_write(self, timeout: float = -1, *, blocking: bool = True) -> AsyncAcquireReadWriteReturnProxy: |
| 189 | """ |