MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / wait_empty

Method wait_empty

pywebio/utils.py:213–224  ·  view source on GitHub ↗

等待队列内的数据被取走

(self, timeout=None)

Source from the content-addressed store, hash-verified

211 return []
212
213 def wait_empty(self, timeout=None):
214 """等待队列内的数据被取走"""
215 with self.not_full:
216 if self._qsize() == 0:
217 return
218
219 if timeout is None:
220 self.not_full.wait()
221 elif timeout < 0:
222 raise ValueError("'timeout' must be a non-negative number")
223 else:
224 self.not_full.wait(timeout)
225
226 def _init(self, maxsize):
227 self.queue = []

Callers 1

_cleanupMethod · 0.80

Calls 1

_qsizeMethod · 0.95

Tested by

no test coverage detected