python-3.x - 如何在扭曲的另一个延迟线程中使用一个线程函数的结果
问题描述
我的 Twisted 服务器代码:
@app.route("/output", methods=['GET'])
@inlineCallbacks
@authenticate
def predict(request):
request_params = request.args
logger.debug("request param are {}".format(request_params))
output = request_params['text']
RESPONSE = yield threads.deferToThread(inference,output)
PTAG = yield threads.deferToThread(tagging,RESPONSE['modified'],pattern1,pattern2)
RESULT = yield threads.deferToThread(result,RESPONSE['modified'],enco)
现在对于方法标记,我想从第一次产量中使用 RESPONSE 字典的键“修改”。但它似乎比我的同步服务器花费更多的时间
解决方案
推荐阅读
- python - 相当于允许加权的 numpy.linalg.lstsq
- ios - 如何使用没有固定高度和固定宽度的自动布局维护圆形 uiview
- reporting-services - SSRS 表达式在文本框之间求和
- c - 通过双指针反转链表
- python - 在python中将文件从客户端上传到服务器,反之亦然
- python - Django - Ajax POST 错误 403(禁止)和 500(内部服务器错误)
- jquery - 将方法添加到 jQuery .validate 以检查summernote textarea 是否为空
- python - 使用“If key in dict:”在python字典中搜索一个键似乎不起作用
- c++ - 在类内成员更改时终止线程中的循环
- sharepoint - 用于本地 SharePoint 2013、Power BI 和自定义 Web 应用程序的 ADFS 单点登录?