Python yield 使用浅析
廖雪峰Python教程–协程
def consumer():
r = ''
while True:
n = yield r
if not n:
return
print('[消费者]消费 %s...' % n)
r = '200 OK'
Python yield 使用浅析
廖雪峰Python教程–协程
def consumer():
r = ''
while True:
n = yield r
if not n:
return
print('[消费者]消费 %s...' % n)
r = '200 OK'