python 利用yield实现一个异步请求

import time def consumer(name): print('%s准备吃包子了!'% name) while(True): baozi = yield print('包子%s来了,被%s吃了!'%(baozi,name)) def producer(name): c = consumer('a') c2 = consumer('b
相关文章
相关标签/搜索