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

get_multiplexed_async_std_connection complains about missing tokio runtime #700

Closed
UgnilJoZ opened this issue Oct 26, 2022 · 2 comments · Fixed by #701
Closed

get_multiplexed_async_std_connection complains about missing tokio runtime #700

UgnilJoZ opened this issue Oct 26, 2022 · 2 comments · Fixed by #701

Comments

@UgnilJoZ
Copy link
Contributor

I try to instantiate a multiplexed async connection like the following:

#[async_std::main]
async fn main() {
    redis::Client::open("redis://127.1/")
        .unwrap()
        .get_multiplexed_async_std_connection()
        .await
        .unwrap();
}

In version 0.22, the second unwrap panics with thread 'main' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x runtime', /home/…/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/net/addr.rs:219:48:

[dependencies]
redis = {version = "0.22", features = ["async-std-comp"]}
async-std = { version = "1", features = [ "attributes" ] }

The panic vanishes if I change "version" to 0.21.

@djc
Copy link
Contributor

djc commented Oct 26, 2022

I bisected this, it seems the originating commit is from #606. So in this PR it seems I forgot that we couldn't depend on Tokio directly, and we need to implement DNS lookup with async-std in the case async-std-comp is enabled.

Would you be able to submit a PR for this?

@UgnilJoZ
Copy link
Contributor Author

Thanks, this is a fast response! I'll push a PR.

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 a pull request may close this issue.

2 participants