XAMPPRocky / octocrab

A modern, extensible GitHub API Client for Rust.
Other
1.11k stars 266 forks source link

Support Alternative Runtimes #257

Open maflcko opened 2 years ago

maflcko commented 2 years ago

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 commented 2 years ago

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

maflcko commented 1 year ago

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

XAMPPRocky commented 1 year ago

@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.