-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Async traits #159
Comments
The short answer is that, unfortunately, For context: the last time the question of This solved the async transport question, but it didn't solve the async handler question, like you're running into. It seems most folks don't really mind this limitation, but its certainly a limitation nonetheless. The The questions that immediately come to mind here are:
I'm happy to use this issue as a tracking issue for folks to express interest in the feature, as well as explore / answer some of the questions I've posed above. I'm not sure when I'll have cycles to do some of this work myself, but if you / other folks are interested in helping explore the design-space here, I could certainly try to find some more time and motivation to help work through some of these questions, and/or review some PRs. |
It might seem simplistic, but one potential solution could be duplicating all the code handling incoming data into an asynchronous function. |
Yep, that's certainly an option, and one of the things I was thinking about when I posited: "At the Note that whatever solution we come up with here needs to adhere to one "non-negotiable" property: For a time, it seemed like Rust might gain some kind of keyword generics mechanism, to allow a single codebase to expose both sync and async APIs, but to my knowledge, that effort is stalling, and/or may not be the direction the language decides to go in. In the absence of that sort of language level mechanism, I'm not sure what the current "state of the art" is for supporting that sort of parallel sync vs. async API. There's also the possibility of swapping the entire That said: this solution must conform to one critical property for it to be viable: it cannot bloat the binary size of minimal If you or someone else would like to experiment with this approach, and profile what the impact looks like on codegen, that would be incredibly useful. If it turns out my gut was wrong, and this approach has minimal codegen impact, then I would be more than happy to go with this approach, as it maintains the "single source-of-truth" property without requiring any macros / build-system shenanigans. |
Hi, I'm using gdbstub crate very well.
I'm writing code for gdbserver that controls embedded system in kernel. Preferred action is to write/read device file in implementing traits like
SingleThreadSingleStep::step()
orSwBreakpoint::add_sw_breakpoint()
.I want to use async file write in these functions but they are not async callback.
Is there any good way to call async function in these traits? or it needs some patch?
The text was updated successfully, but these errors were encountered: