Skip to content
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

Merged
merged 8 commits into from
Mar 18, 2024
Merged

Conversation

tisonkun
Copy link
Member

Support customize async executor (runtime)

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>
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 {
Copy link
Member Author

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
Copy link
Member Author

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.

@Xuanwo Xuanwo changed the title feat: explicit async runtime feat(bindings/java): explicit async runtime Mar 18, 2024
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, and thanks!

@Xuanwo Xuanwo merged commit 4c1752b into apache:main Mar 18, 2024
56 checks passed
@tisonkun tisonkun deleted the asyncruntime branch March 18, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants