hyperium / hyper

An HTTP library for Rust
https://hyper.rs
MIT License
14.42k stars 1.59k forks source link

Document the `runtime` feature #1613

Closed sanmai-NL closed 2 years ago

sanmai-NL commented 6 years ago

Only found this: https://github.com/hyperium/hyper/commit/d127201ef22b10ab1d84b3f2215863eb2d03bfcb. In general, all features should be documented esp. if they are mentioned in e.g. the changelog (i.e. not internal/temporary/experimental).

Question the docs would address:

  1. What is the value of the Tokio runtime itself?
  2. Pointers on how to use alternative runtimes?
seanmonstar commented 6 years ago

Good point! Where is a good place for this to appear? In the module documentation of hyper::rt?

sanmai-NL commented 6 years ago

Imagine someone new to hyper. First thing he or she will do is adding it as dependency. Then they’ll ask themselves what features to enable in Cargo.toml. So, the best place would be the README being the first encounter with docs. This short overview of features can contain a pointer perhaps to some elaboration in the API docs.

danieleades commented 5 years ago

I am using hyper (or reqwest) in a couple of projects now, and i'd like to experiment with other runtimes (such as https://github.com/rustasync/runtime). Hyper and reqwest appear to be implicitly dependent on the tokio runtime. Is there a away around this dependency?

seanmonstar commented 5 years ago

The feature is enabled by default in hyper, you can disable it and provide your own Connect and Executor.

We could open an issue in reqwest about this is as well.

danieleades commented 5 years ago

Ah thanks, that makes perfect sense

Found this a really interesting read-

https://users.rust-lang.org/t/poll-async-await-lets-talk-about-executors/31753

It's about trying to find a consistent way across the ecosystem to make Executor/Spawn generic. Zero consensus of course.

lorislibralato commented 2 years ago

We can close this because of 1.0 runtime future remove

seanmonstar commented 2 years ago

Good point!