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
相關文章
相關標籤/搜索