MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / read

Method read

openkb/locks.py:57–68  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

55
56 @contextlib.contextmanager
57 def read(self) -> Iterator[None]:
58 with self._condition:
59 while self._writer:
60 self._condition.wait()
61 self._readers += 1
62 try:
63 yield
64 finally:
65 with self._condition:
66 self._readers -= 1
67 if self._readers == 0:
68 self._condition.notify_all()
69
70 @contextlib.contextmanager
71 def write(self) -> Iterator[None]:

Callers 5

hash_fileMethod · 0.80
_download_pdf_chunkedFunction · 0.80
fetch_url_to_rawFunction · 0.80
feedbackFunction · 0.80
kb_lockFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected