octocrab
octocrab copied to clipboard
Support Alternative Runtimes
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
- [x] https://github.com/hyperium/hyper/issues/3110
Thank you for your issue! It's required until #99 is implemented, closing this as a duplicate of that.
It looks like #99 is closed, but on the latest version (alpha3), the error message is still there
@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.