2025年4月15日 星期二 乙巳(蛇)年 正月十六 设为首页 加入收藏
rss
您当前的位置:首页 > 计算机 > 编程开发 > Python

Python 中 tornado 使用协程

时间:12-14来源:作者:点击数:9
城东书院 www.cdsy.xyz

Python 中 tornado 使用协程

  • from tornado.web import asynchronous
  • from tornado.concurrent import run_on_executor
  • from concurrent.futures import ThreadPoolExecutor
  • class xxx
  • executor = ThreadPoolExecutor(10)
  • @delete(_path=r"/xxx/{id}", _produces=mediatypes.APPLICATION_JSON)
  • @asynchronous
  • @gen.coroutine
  • def delete_much_things(self,id):
  • yield do_delete(id)
  • @run_on_executor
  • def do_delete(self,id):
  • pass
城东书院 www.cdsy.xyz
方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门
本栏推荐