-
Notifications
You must be signed in to change notification settings - Fork 307
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
Add support for nuclei #1846
Comments
Hi! Thanks for opening your first issue here! 😄 |
Looks interesting! I am not an expert on the crates you mentioned, so it would be great to firstly know some background. For example, do you mean that nuclei acts as a replacement of tokio for async runtime? This does seem to be possible since frb does not enforce one specific async system (but may need a bit of refactor for some details if needed). |
Yes mostly I think it's possible to be guarded by a feature like rust-async-nuclei and will be used instead of tokio In a asynchronous runtime there is two important sections Executor and reactor Also there is two different patterns reactor and proactor Both tokio and async-std is using reactor model Nuclei is a very young crate that is implemented with proactor pattern and that is using io_uring in linux for example |
I see. I guess it would be great to allow users to define their own async runtimes. For example, currently we use https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/frb_rust/src/rust_async/io.rs (for non-web) and https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/frb_rust/src/rust_async/web.rs (for web). I guess it may be possible to abstract out a bit more s.t. we can change to arbitrary runtime. For example, instead of hardcoding pub trait BaseAsyncRuntime {
type JoinHandle;
fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
where
F: Future + Send + 'static,
F::Output: Send + 'static;
}
impl BaseAsyncRuntime for SimpleAsyncRuntime {
JoinHandle = tokio::task::JoinHandle
...
} |
Exactly I will create a PR for you to review and then we can discuss base on code in more detail |
Looking forward to it! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue. |
Is your feature request related to a problem? Please describe.
I like to use proactor-based IO system in rust for flutter
Describe the solution you'd like
Currently only this crate nuclei doing this so it should be supported by the code
Additional context
Base on what I see it's possible to add new feature like rust-async-nuclei and use this lib and should not there any problem
I can do this and create PR for it, if it's align with project
The text was updated successfully, but these errors were encountered: