MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / wait_for

Method wait_for

tools/python-3.11.9-amd64/Lib/asyncio/locks.py:285–296  ·  view source on GitHub ↗

Wait until a predicate becomes true. The predicate should be a callable which result will be interpreted as a boolean value. The final predicate value is the return value.

(self, predicate)

Source from the content-addressed store, hash-verified

283 raise exceptions.CancelledError
284
285 async def wait_for(self, predicate):
286 """Wait until a predicate becomes true.
287
288 The predicate should be a callable which result will be
289 interpreted as a boolean value. The final predicate value is
290 the return value.
291 """
292 result = predicate()
293 while not result:
294 await self.wait()
295 result = predicate()
296 return result
297
298 def notify(self, n=1):
299 """By default, wake up one coroutine waiting on this condition, if any.

Callers 3

_blockMethod · 0.45
_waitMethod · 0.45
run_one_coroFunction · 0.45

Calls 2

waitMethod · 0.95
predicateFunction · 0.85

Tested by

no test coverage detected