-
Notifications
You must be signed in to change notification settings - Fork 978
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
Makes async traits in the SDK be Send
#1894
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, Thanks for the changelog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will be a problem for the namada interface; see rustwasm/wasm-bindgen#2833
We can gate the ability to send futures across threads with something like:
#[cfg_attr(not(feature = "send-sdk-client"), async_trait(?Send))]
#[cfg_attr(feature = "send-sdk-client", async_trait)]
trait Client { ... }
12b2cf8
to
d89c660
Compare
* origin/grarco/sdk-async-traits-send: changelog: add #1894 Conditionally requires async traits `Send`ness Makes async traits in the SDK be `Send`
…rarco/sdk-async-traits-send: changelog: add #1894 Conditionally requires async traits `Send`ness Makes async traits in the SDK be `Send`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, and works well for me!
Describe your changes
Requires the
Send
bound on theasync_traits
s in the SDK. This allow the usage of the SDK in an environment which is both async and multithread (see https://rust-lang.github.io/async-book/07_workarounds/03_send_approximation.html).Indicate on which release or other PRs this topic is based on
v0.22.0
Checklist before merging to
draft