MCPcopy
hub / github.com/tornadoweb/tornado / acquire

Method acquire

tornado/locks.py:528–536  ·  view source on GitHub ↗

Attempt to lock. Returns an awaitable. Returns an awaitable, which raises `tornado.util.TimeoutError` after a timeout.

(
        self, timeout: Optional[Union[float, datetime.timedelta]] = None
    )

Source from the content-addressed store, hash-verified

526 return f"<{self.__class__.__name__} _block={self._block}>"
527
528 def acquire(
529 self, timeout: Optional[Union[float, datetime.timedelta]] = None
530 ) -> Awaitable[_ReleasingContextManager]:
531 """Attempt to lock. Returns an awaitable.
532
533 Returns an awaitable, which raises `tornado.util.TimeoutError` after a
534 timeout.
535 """
536 return self._block.acquire(timeout)
537
538 def release(self) -> None:
539 """Unlock.

Callers 10

__aenter__Method · 0.95
test_reprMethod · 0.95
test_acquire_releaseMethod · 0.95
test_acquire_fifoMethod · 0.95
test_acquire_timeoutMethod · 0.95
test_multi_releaseMethod · 0.95
fMethod · 0.45
fMethod · 0.45

Calls

no outgoing calls

Tested by 9

test_reprMethod · 0.76
test_acquire_releaseMethod · 0.76
test_acquire_fifoMethod · 0.76
test_acquire_timeoutMethod · 0.76
test_multi_releaseMethod · 0.76
fMethod · 0.36
fMethod · 0.36