def receive_wait(self, filter_fn: Callable):
""" Repeatedly call receive(filter) until the result is found. Other
greenlets can continue to run cooperatively.
:param filter_fn: A callable which checks if message is desired
(and returns True) or should be skipped (and returns False)
"""
while True:
LOG(self.queue_.queue)
m = self.receive(filter_fn=filter_fn)
if m is not None:
return m
gevent.sleep(0.0)
评论列表
文章目录