Closed nick5435 closed 5 years ago
@nick5435 I just did a bunch of research to see what the damage would be to implement this via pyserial-asyncio. It's a pretty substantial amount of work. I don't know what your use-case is (if you still have on > 1 year later), but if you're not communicating lots and lots of data, you're probably just better off making a thread like so:
while True:
msg = c.receive()
# do stuff with msg, probably on another thread
I haven't worked on the project that used this for over a year. I believe we ended up doing something similar with multithreading.
Could be a good idea to implement
CmdMessenger.receive
as an asynchronous task, that way tasks don't get blocked listening for a response. PySerial has started a Pyserial-Asyncio client.