Open notgull opened 8 months ago
I think this is something we could do, though it would be a breaking change and highlighting why it's worth it, and also how we would track the differences with hyper, would be good to do.
, though it would be a breaking change and highlighting why it's worth it
It would enable usage of hyper
and h2
in runtimes that aren't tokio
.
also how we would track the differences with hyper,
Maybe we can extract the hyper
traits into a separate crate?
Hm. It's already been possible to use hyper and h2 with different runtimes. I've seen hyper 0.14 work with curl, async-std, and Fuchsia. Using just the traits from Tokio doesn't make it use the runtime, or even enable all the runtime code. The reason why hyper made its own traits was to be able to update them independently for eventual io-uring upgrades. I don't really want to extract those traits to a separate crate, I don't mean for them to be used throughout the ecosystem. They're just how to hook into hyper.
That said, I do still think this is something that could be done for h2, with other motivations brought up.
I think the idea is to not bring in Tokio as a dependency at all while still being able to use h2
.
Would it be accepted to replace the
tokio
I/O traits with more general I/O traits, like what happened inhyper
? If so, I can implement this.