但是,当我在下一行.await时,我会得到错误“捕获的值不是Send”。`note: captured value is not `Send` | = note: required for the cast to the object type `dyn Future<Output = ()> + Send`
help: considerfurther restrictin
我的网络中有一些硬件设备,我需要每隔100ms从它们读取数据,我需要一些异步的方式来做到这一点,而不是等待每次调用。一种方法是使用线程,另一种方法是使用使用loop.run_executer方法的异步for (为每个调用创建线程)。在这两种情况下,它都是异步的,所以我真的不明白异步给了我们线程不能给我们的东西。例如,如何将下一段代码转换为异步代码: def _send(self, data):
"""Send data o
|92 | | }note: future is not `Send` as it awaits another future which is not `Send`
--> src/lib.rs^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs
我使用龙卷风和异步API来构建异步API服务。几周内一切正常,但今天出现了问题。异步the缓存的几乎所有服务都会引发StreamClosedError。龙卷风日志上写着:
ile "/opt/python2.7/lib/python2.7/site-packages/tornado-4.1-py2.7-linux-x86_64.egg/tornado/_64/egg/asyncmc/client.py&q