-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asynchronous operations #2
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: gabrik <[email protected]>
Signed-off-by: gabrik <[email protected]>
Signed-off-by: gabrik <[email protected]>
Hey, just wanted to let you know I haven't forgotten about this yet. I'm a bit busy, but I will definitely make time for this. /edit: And of course, thanks for opening the PR! :) |
I see that the build fails because of the |
Signed-off-by: gabrik <[email protected]>
Signed-off-by: gabrik <[email protected]>
Signed-off-by: gabrik <[email protected]>
Signed-off-by: gabrik <[email protected]>
Signed-off-by: gabrik <[email protected]>
Signed-off-by: gabrik <[email protected]>
It should be fine now, tested locally, and on my fork, I had issues with the |
I haven't done an in-depth review yet, but it looks like now, enabling a feature changes the existing Bus into an In general, enabling features should not break code that doesn't need/use the feature. This is especially important because two crates might use the same dependency with different sets of features. It's not very likely for this crate, but we should still support it. So I suggest a slightly different approach: each feature should enable a new submodule that contains the implementation for that back-end. So the The current implementation could be moved to a |
Another thing that I was considering: it would be cool to see if we can still re-use the decode code. Maybe an internal The different async/sync implementations would then all call the same encode/decode functions, but take care of the reading/writing/buffer-clearing. |
Thanks for the comments, I'll rearrange the code as you suggested |
Hi, as mentioned in #1 here is a PR that implements asynchronous operations for interacting using the Dynamixel2 protocol.
Features
sync
feature for the current behavior and interfaceasync_smol
feature for asynchronous operation withinasync_std
async_tokio
feature for asynchronous operation withintokio
There is still (a lot) a code copy-pasted from sync to async implementation, mostly because of the different signatures and
await
here and there.I tested it on my MacBook with a OpenCR board, I'm really open to feedbacks