def work(self, queues, **kwargs):
# ??????queue??????
self.command_queue = command_queue = queues['command_queue']
self.data_queue = data_queue = queues['data_queue']
while True:
# ????
cmd = command_queue.get()
# ??????????
if cmd:
raw_datas = self.user_check(cmd)
if isinstance(raw_datas, types.GeneratorType):
for raw_data in raw_datas:
# ?????????handler
data_queue.put(raw_data)
else:
# ?????????handler
data_queue.put(raw_datas)
else:
log.error('\nNo command received')
kwargs['record'].thread_signal[kwargs['name']] = time.time()
评论列表
文章目录