Skip to content

Conversation

@if0ne
Copy link
Contributor

@if0ne if0ne commented Nov 11, 2025

Closes #3711

This is not an ideal solution, but we need to think about sync/async ergonomics in the future.

At the moment, there is a problem: the inability to use this approach in single-thread runtime.

@if0ne if0ne requested a review from wjones127 as a code owner November 11, 2025 08:07
@github-actions github-actions bot added this to the ADBC Libraries 22 milestone Nov 11, 2025
@lidavidm
Copy link
Member

CC @eitsupi

@eitsupi
Copy link
Contributor

eitsupi commented Nov 11, 2025

Thank you. I'm not familiar with tokio, so I'm not sure if this solution is a good one.
I read the following thread:
https://users.rust-lang.org/t/accessing-the-current-tokio-runtime-to-call-block-on/50090

@if0ne
Copy link
Contributor Author

if0ne commented Nov 11, 2025

IMO, it is best to enable users to implement the sync/async API for the driver using maybe_async or new async traits.

@lidavidm
Copy link
Member

@zeroshade we should look at Rust APIs as part of the current effort to add async APIs

@eitsupi or @mbrobbel thoughts there?

As for this PR: I think it looks OK, but I'm not an expert on Tokio. My main question is whether the driver should instead allow you to pass your own Handle in during construction so you can provide the async runtime explicitly? Otherwise I think falling back to the ambient runtime and only creating the runtime as a last resort makes sense

@if0ne
Copy link
Contributor Author

if0ne commented Nov 12, 2025

Made Handle passing explicit

@eitsupi
Copy link
Contributor

eitsupi commented Nov 13, 2025

Thank you, this seems reasonable until async supports are implemented.

Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

Thanks!

@lidavidm lidavidm merged commit d411cab into apache:main Nov 14, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust/driver/datafusion: using datafusion in async runtime

3 participants