def loop(self, *args, **kwargs):
if "discrete" in kwargs:
discreteVal = kwargs["discrete"]
del kwargs["discrete"]
while True:
asyncore.loop(*args, **kwargs)
time.sleep(discreteVal)
try:
callback = self.__class__.__detachedQueue.get(False) #doesn't block
callback()
except Queue.Empty:
pass
else:
asyncore.loop(*args, **kwargs)
评论列表
文章目录