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

getting started rewrite + intro to tokio features #394

Merged
merged 17 commits into from
Jan 14, 2020

Conversation

ultrasaurus
Copy link
Contributor

@ultrasaurus ultrasaurus commented Jan 9, 2020

  1. simplify "hello world"

    • use socat which hopefully doesn't have the same cross-platform issues as we were running into with netcat
    • intro network utils first (which also provides a gentle intro to networking)
    • app wasn't using io so removed from text
    • adjust text to describe hello-world as a client app (since that's what it is)
  2. new page: intro to feature dependencies. The idea is to just walk through the few feature that are used in the "hello world" app so that people understand the concept.

    • outline the reasons why to use features=full or select specific features.
    • Later we'd like to add a topic page that goes into more detail about all of the feature groupings, and this page would then link to that (or we could even make this into a smaller call out when we have that complete info). -- [topic] cargo dependencies: features = ... #401 for feature topic page
  3. Network utilities section -- this is a bit bare bones right now. I didn't feel good about using anything in the guide without install instructions and it's a bit verbose without instructions. -- open issue for x-platform testing and maybe using nc instead of telnet test install instructions for network utils on Mac, Windows, Unix #407

@ultrasaurus
Copy link
Contributor Author

Would appreciate if @carllerche or someone could review this for technical accuracy -- I have a couple of folks who are new(er) to tokio and will review for clarity, but want to make sure I'm not misleading them!

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nothing blocking :) Great work!

@LucioFranco
Copy link
Member

also feel free to ping me for more reviews

@jenmei
Copy link
Contributor

jenmei commented Jan 10, 2020

This is great!

I suggest we add a section at the beginning that says what audience we're writing this for (e.g. people new to Tokio but not Rust).

Also I would add a section saying what version this code was tested with and mention the min. version of Rust that works with this tutorial.

Also, I think it would be helpful if we preface code blocks with filenames.

@ultrasaurus ultrasaurus changed the title intro to tokio features getting started rewrite + intro to tokio features Jan 13, 2020
@ultrasaurus
Copy link
Contributor Author

I think I've addressed all the feedback. I would like someone to proof-read the text and plan to write issues for the TODOs in the PR description above.

abstractions over networking and I/O-operations as the corresponding modules in
`std` with a difference: all actions are performed asynchronously.
An easy way to simulate a client (for a text-based protocol) is to use
[`telnet`]. To connect to our simulated server, we'll open a different
Copy link
Contributor

@jenmei jenmei Jan 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for not providing this feedback before, but I would suggest using netcat (nc) instead of telnet. I think nc is now more likely to be found on OSes (including Mac OS X) without a separate install. Also, as network code debugging tool, telnet can have some weird side effects (because it's primarily written for the telnet protocol, which is almost, but not quite, plain text; see the Wikipedia page).

Comment on lines 80 to 84
Let's quit telnet and write some Rust code to send some text to our server.
To *escape* from our TCP session (`^]`), we need to hold down `Ctrl` key and
type `]`). Then at the telnet prompt (`telnet >`), typing `quit` will close
the connection and exit the program. (Closing the Telnet/TCP connection
also causes socat to quit.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With nc exiting is just ctrl-d so less to read. :-)

## Debian / Ubuntu Linux

```bash
sudo apt-get update && sudo apt-get install telnet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure nc is included on Debian and Ubuntu by default, but haven't confirmed.

## Mac Homebrew

```bash
brew install telnet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nc is included on Mac OS X (telnet has been removed starting with High Sierra).

@ultrasaurus
Copy link
Contributor Author

added consideration for nc to issue about testing network utils: #407

@ultrasaurus ultrasaurus merged commit c1151f0 into tokio-rs:master Jan 14, 2020
@ultrasaurus ultrasaurus deleted the hello-features branch January 14, 2020 15:58
jefflembeck pushed a commit to jefflembeck/website that referenced this pull request Apr 3, 2020
fix(docs): line about npm run setup
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

Successfully merging this pull request may close these issues.

3 participants