def line_reader(apipe, coro=None):
nlines = 0
while True:
try:
line = yield apipe.readline()
except:
asyncoro.logger.debug('read failed')
asyncoro.logger.debug(traceback.format_exc())
break
nlines += 1
if not line:
break
print(line.decode())
raise StopIteration(nlines)
# asyncoro.logger.setLevel(asyncoro.Logger.DEBUG)
评论列表
文章目录