Skip to content

Make examples usable (TokioIo) #3448

Open

Description

@inferrna

Currently, one does not simple create own project based on provided examples because almost all examples depends on internal structure TokioIo.

PS: already found TokioIo in hyper-util crate. At least, it should be added to
https://github.com/hyperium/hyper/tree/master/examples#dependencies

Activity

  1. added
    C-bugCategory: bug. Something is wrong. This is bad!
    on Nov 28, 2023
  2. seanmonstar commented on Nov 28, 2023

    @seanmonstar
    Member

    As mentioned in the hello example, we can't depend on hyper-util in hyper, because then it becomes a cyclical dependency.

    Unless we changed the examples to not be a separate crate, instead of natural examples of hyper.

  3. inferrna commented on Nov 29, 2023

    @inferrna
    Author

    Ok. Steps to reproduce.

    1. Forget all you know about hyper (If you can't do this, then try next steps on your grandma)
    2. Open examples
    3. Try to make own crate based on any of the examples using the README as a main information source.

    I was succeeded after I googled https://hyper.rs/guides/1/client/basic/, and I would do this faster if there wasn't any README in examples folder (I used to trust README files)

  4. BuddhiAbeyratneAL commented on Dec 20, 2023

    @BuddhiAbeyratneAL

    can be closed.

  5. erikschul commented on Jan 5, 2024

    @erikschul

    @seanmonstar If hyper can't be used without the code, then maybe it shouldn't live in a separate hyper_util ?

  6. notgull commented on Jan 5, 2024

    @notgull

    You can have non-Tokio reactors for Hyper, e.g. https://github.com/notgull/smol-hyper

  7. dswij commented on Jan 9, 2024

    @dswij
    Member

    @seanmonstar If hyper can't be used without the code, then maybe it shouldn't live in a separate hyper_util ?

    The whole idea is to allow users to easily choose a reactor for hyper (while also making it independent of tokio). tokio is the one mainly used at the moment, so some common and simple implementations for tokio with hyper are provided in the hyper-util crate instead.

  8. seanmonstar commented on Jan 9, 2024

    @seanmonstar
    Member

    I do agree with the desire for the examples to be immediately usable. Perhaps the best solution is to convert the examples into a crate that's part of the workspace, instead of the crate "examples", and then we can properly depend on hyper-util in there. Is there a downside I'm not thinking off?

  9. dswij commented on Jan 9, 2024

    @dswij
    Member

    @seanmonstar or perhaps we can point users directly to hyper-util crate for examples? with a note saying hyper itself is for a lower-level usecase

  10. added
    A-docsArea: documentation.
    C-choreCategory: chore. a general chore or maintenance task.
    and removed
    C-bugCategory: bug. Something is wrong. This is bad!
    on Jan 19, 2024
  11. thrawn01 commented on Jun 9, 2024

    @thrawn01

    What are the objections against exposing support::TokioIo publicly? Having an example which is essentially unusable without depending on a third-party library is very strange, and led to quite a bit of head scratching on my part.

    Even though hyper is reactor agnostic, it should have an implementation which works with a rector implementation out of the box. No flexibility is lost, while also allowing new users to Fall into the pit of success

  12. dswij commented on Jun 10, 2024

    @dswij
    Member

    We provided a simple Tokio runtime implementations in hyper-util.

    This is not a third-party library, it's maintained by hyper's maintainers.

  13. thrawn01 commented on Jun 10, 2024

    @thrawn01

    Thanks, I found it before commenting here. It says This crate is less-stable than hyper, Which doesn't fill me with confidence.

    Should we consider it stable and safe to use with hyper 1.0?

  14. dswij commented on Jun 10, 2024

    @dswij
    Member

    It is safe to use with hyper 1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: documentation.C-choreCategory: chore. a general chore or maintenance task.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions