MCPcopy Create free account
hub / github.com/tox-dev/filelock / can_write

Function can_write

tests/sqlite/async_helpers.py:31–37  ·  view source on GitHub ↗
(lock: AsyncReadWriteLock)

Source from the content-addressed store, hash-verified

29
30
31async def can_write(lock: AsyncReadWriteLock) -> bool:
32 try:
33 await lock.acquire_write(blocking=False)
34 except Timeout:
35 return False
36 await lock.release()
37 return True
38
39
40async def write_once(lock: AsyncReadWriteLock) -> None:

Calls 2

acquire_writeMethod · 0.45
releaseMethod · 0.45