Add async version of send_message for both tcp and rtu#110
Add async version of send_message for both tcp and rtu#110tiagocoutinho wants to merge 13 commits intoAdvancedClimateSystems:masterfrom
Conversation
|
Thanks for this PR! I might need a bit of time to review the PR and test it myself. I'll come back to you. |
|
You're welcome. |
There was a problem hiding this comment.
Hey @tiagocoutinho , thanks for your contribution. This is a great addition to uModbus. Just had some comments for you to look at, before we can merge.
I'm personally also not a big fan of the async_send_message names. Maybe the async method could be moved to an asyncio module so it could be used like
from umodbus.client.tcp.asyncio import send_message
await send_message(...)|
Hi @jaapz, I am in favour of moving the So, long story short, what do you thing about naming the module |
|
@tiagocoutinho that makes complete sense, calling it |
2acdbae to
bb7cbbc
Compare
You read my mind :-) |
|
I think it should be ready for review now. |
jaapz
left a comment
There was a problem hiding this comment.
Just a few small changes/comments, almost there! Again, great work, thanks for your contributions and thanks for bearing with me during the review.
|
I've done another small review, everything else looks good to me. Maybe @OrangeTux can take over from here to test it a bit and get this merged and released? |
|
Hi @OrangeTux , @jaapz, |
|
Hey @tiagocoutinho, I just need some time to properly test this before merging. Sorry for the wait, I'm pretty busy at the moment |
Now that #86 is out I feel more comfortable making this PR since the new async/await python 3 syntax makes it impossible to use with python 2.
This PR proposes to add an async version of send_message for both tcp and rtu.
We will be able to write asyncio based clients like this:
We are not restricted to TCP. Any I/O library supporting asyncio StreamReader and StreamWriter interface (example: serial_asyncio) can be used with either the TCP or RTU versions of
async_send_message.