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)
| 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. |
no test coverage detected