-
Notifications
You must be signed in to change notification settings - Fork 509
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
feat(bindings/java): explicit async runtime #4376
Conversation
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
JNIEnv::from_raw(env).expect("env must be valid") | ||
} | ||
|
||
pub enum Executor { |
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.
It should possibly support other runtimes. This encapsulation is lightweight and we leave the room for enhancement instead of hard code using Tokio.
} | ||
|
||
impl Executor { | ||
pub fn enter_with<F, R>(&self, f: F) -> R |
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.
The blocking layer should be able to decouple from Tokio also.
Perhaps using executor-trait and support passing a different executor.
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.
Cool, and thanks!
Support customize async executor (runtime)