Open murilopolese opened 6 years ago
While not a perfect solution because introduce a race condition, removing the creation of a coroutine for waiting the response makes it possible to call rpc_request
from a method called from the Executor
. The rpc_request
was always meant to be blocking so instead of running it on the asyncio
thread it's actually running on the main thread.
For requests that require a faster rate, such as stream_frame
it doesn't use the blocking rpc_request
but sends the data straight to the connection.
https://github.com/KanoComputing/community-sdk/commit/c74dcff47fca03ed26a5b8e18b7cb222abdd606a
Can't get event loop from inside a coroutine, apparently. I have no idea how to fix this and it's probably because I should be doing this in a different way.
This code:
Prints
There is no current event loop in thread 'ThreadPoolExecutor-0_0'.
when I swipe up on Motion Sensor.