tokio-rs / doc-push

Tokio doc blitz effort - A concerted effort to improve Tokio's documentation.
MIT License
50 stars 7 forks source link

Beginner tutorial building an IRC client #98

Open ultrasaurus opened 5 years ago

ultrasaurus commented 5 years ago

Concept: create IRC bot that connects to gitter

IRC is a very simple line-based protocol, we should be able to build a bot with a subset of the full-protocol (5-6 commands)

Draft sequence of steps:

  1. Connect to the server
  2. Send/Receive IRC messages
  3. bot says Hello
  4. bot respond to question
  5. no channel activity for certain amount of time, say "is anyone here?"

Key concepts

References

ultrasaurus commented 5 years ago

working on ideas for this tutorial here: https://github.com/ultrasaurus/irc-tokio

ultrasaurus commented 4 years ago

I've made a bit of progress, would love feedback, details in the repo README for now. Will work on figuring out what open questions I have and looking for answers or filing issues.

My biggest question is how to test something that uses a TcpStream. The tokio repo doesn't seem to have examples of that. Probably should structure the code differently to make it testable.

Ralith commented 4 years ago

Abstracting over AsyncRead + AsyncWrite is the usual advice there.