-
Notifications
You must be signed in to change notification settings - Fork 160
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
Ditch async_trait
in favor of the official async_fn_in_trait
feature
#959
Comments
👋 Thanks for opening this issue! Get help or engage by:
|
Update: just tried to remove |
Make sense. Since you've already provided an entry in Before that, I think I should add a single threaded application example as a test for |
Great! Then I'll try removing |
Change: #959 ditch async_trait for the singlethreade feature
@wvwwvwwv Is there any additional action required? |
Nope, we can close this issue for now since we cannot currently get rid of every async_trait usage due to some limitations in the Rust compiler. |
Hello @drmingdrmer,
I guess you may already be aware of it, but the
async_fn_in_trait
feature has recently been stabilized in the nightly Rust channel and will be generally available in Rust 1.75.0. Currently,openraft
heavily relies on the use ofasync_trait
in order to provide asynchronous methods in traits, but obviously,async_trait
has a negative effect on overall performance in many cases due to heap memory allocation.So, I suggest that we try to get rid of
async_trait
incrementally.async fn
and return-positionimpl Trait
in trait rust-lang/rust#115822async_fn_in_trait
and related language features, e.g.,Send
bound errors.Send
bound error, I think we should firstly focus on the!OptionalSend
case.The text was updated successfully, but these errors were encountered: