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

Support Alternative Runtimes #257

Open
1 task done
maflcko opened this issue Oct 19, 2022 · 3 comments
Open
1 task done

Support Alternative Runtimes #257

maflcko opened this issue Oct 19, 2022 · 3 comments

Comments

@maflcko
Copy link
Contributor

maflcko commented Oct 19, 2022

I want to write a simple single-threaded program that blocks on the API call. Is this possible?

My attempt fails:

use futures_executor::block_on;

fn main() -> octocrab::Result<()> {
    println!("{}", block_on(octocrab::instance().ratelimit().get())?.rate.used);
    Ok(())
}

With:

thread 'main' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x runtime'

Blockers

@XAMPPRocky
Copy link
Owner

Thank you for your issue! It's required until #99 is implemented, closing this as a duplicate of that.

@maflcko
Copy link
Contributor Author

maflcko commented Apr 13, 2023

It looks like #99 is closed, but on the latest version (alpha3), the error message is still there

@XAMPPRocky XAMPPRocky changed the title Is tokio required? Support Alternative Runtimes Apr 13, 2023
@XAMPPRocky XAMPPRocky reopened this Apr 13, 2023
@XAMPPRocky
Copy link
Owner

@MarcoFalke Sorry you're right, we haven't fully replaced Tokio yet, however I do want this library to be runtime agnostic as soon as possible so I've reopened and edited the title to better match the current state.

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

No branches or pull requests

2 participants