Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ping tutorial using tokio #5554

Closed
P1R opened this issue Aug 13, 2024 · 2 comments
Closed

refactor: ping tutorial using tokio #5554

P1R opened this issue Aug 13, 2024 · 2 comments

Comments

@P1R
Copy link
Contributor

P1R commented Aug 13, 2024

Description

By identifying the missing examples and tests for solving #4449 I identified that the ping tutorial still uses async-std and there is an already refactored tokio ping example. Upon opening, there are some slight differences that might require review.

Motivation

The tokio runtime is much more well established and better maintained. Users should be able to use other runtimes or bring their own.[#4449]

Examples and tests where considered in #4449 but not this tutorial.

Current Implementation

Both runtimes are being mixed.[#4449]

  • async-std in ping tutorial
  • tokio in ping example

Are you planning to do it yourself in a pull request ?

Yes

@P1R
Copy link
Contributor Author

P1R commented Aug 13, 2024

Differences between the ping example and the ping tutorial

Cargo.toml

  • libp2p missing features from tutorial in the example: “tls”, “dns” “websocket”, and “macros”
  • using latest version of the dependencies: SHOULD we use specific versions?

src/main.rs

  • SwarmBuilder tcp config does not implement tcp but noise instead
  • Ping timeout in the tutorial is 30 seconds while in the example is Duration::from_secs(u64::MAX)

Self-reviewed code before modifying the rust-doc tutorial:

@kt-wawro kt-wawro moved this to In progress in PLDG Cohort 0 Project Board Aug 14, 2024
mergify bot pushed a commit that referenced this issue Aug 21, 2024
Solves issue #5554 also referenced first in #4449

Pull-Request: #5559.
@P1R
Copy link
Contributor Author

P1R commented Aug 22, 2024

Solved on PR: #5559

@P1R P1R closed this as completed Aug 22, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in PLDG Cohort 0 Project Board Aug 22, 2024
TimTinkers pushed a commit to unattended-backpack/rust-libp2p that referenced this issue Sep 14, 2024
Solves issue libp2p#5554 also referenced first in libp2p#4449

Pull-Request: libp2p#5559.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant