Does Hyper have any plans to support non-Tokio async or even sync?

Hyper is a great HTTP library, however is limited to async contexts and even a specific async runtime. It cannot directly run synchronously, or run on a smol/async-std runtime. It always needs to carry the weight of a Tokio runtime no matter where it goes. Consider that ISRG is planning to embed Hyper into curl as an option, do you really want curl to contain a Tokio runtime as well?

IIRC Hyper used to support synchronous code, but they very intentionally dropped it and have no intent to support it again. At some point, they recommended using another crate if you need synchronous code.

Why not? What's wrong with that?

curl have its own async runtime, and hyper have no issue to be run on it without tokio runtime spinning.

2 Likes

tokio doesn't seem to be a dependency of hyper. It's only a dev-dependency, but not a runtime-dependency. Only if you use the sync feature, tokio seems to be required.

(Unless tokio is required recursively by some other dependency?)

Tokio is a dependency of Hyper. Here's the Cargo.toml file:

See line 35.

1 Like

Oh, my fault. It is a dependency and a dev-dependency. The normal dependency uses less features though (so it's a bit more lightweight).

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.