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

Various improvements #43

Closed
wants to merge 37 commits into from
Closed

Various improvements #43

wants to merge 37 commits into from

Conversation

Thomasdezeeuw
Copy link
Contributor

I starting review the tokio crates and in doing make a bunch of cleanups commits. Some hightlights:

  • Remove unused code.
  • Replace try! with ?.
  • Prefer to use Err(io::ErrorKind::WouldBlock.into()).
  • Ran rustfmt.
  • Various cleanups to improve clarity of the code flow.
  • Expanded the documentation of about every struct.
  • Expanded the module level documentation on every struct and how they link together.

“not ready” doesn’t add much
This also changes to use mio::Events::iter and moves dispatch to the
Inner part of the core (and changes mutability to &self).
Done by rustfmt.
In some cases rustfmt created rather strange looking code, so I’ve
excluded that from the commit.
- Add links to the futures, mio and tokio-uds crates.
- Add links to various structs and types mentioned.
- use eprintln for error reporting in the example.
In the old version to code flow was somewhat hard to follow, and even
though the new version uses more lines of code I believe it’s easier to
follow.
- Fixed links usage.
- Removed references to a no longer existing `Window` struct.
- Made notes about using functions in context of a future.
- Since HTTP uses TCP (QUIC aside) using it as an example in an UDP
protocol feels wrong.
- Make the note of tampering with the underlying streams more explicit.
Adds an explanation of every public struct.
Adds an explanation of every public struct and how they work together.
Reorder the various option methods; get first then set.
Note about panicing added to poll_read.
Makes it easier to follow and well as reducing the number of lines of
code.
Start testing on OS X.
Print the version of cargo and rustc at the start of the testing,
useful for testing with nightly.
Add cargo to the cache.
Enable the verbose flag while building and testing.
@Thomasdezeeuw
Copy link
Contributor Author

I also made a number of notes about some possible improvement that would break the API. Should a create an issue for each of them (about 6 or so) or 1 big issue?

@Thomasdezeeuw Thomasdezeeuw changed the title Various cleanup commits Various improvements Dec 1, 2017
@carllerche
Copy link
Member

Hi, thanks for the PR!

This seems to be conflating a bunch of things into a one PR. It makes it hard to tell exactly what is going on. It would probably be easier to approach this into more granular PRs. Each PR should make a logical change. This makes it easier to tell how the various changes relate.

Also, please do not run rustfmt. I would rather not take any reformatting changes until rustfmt is stable.

@Thomasdezeeuw
Copy link
Contributor Author

Ok will do, might take some time.

@Thomasdezeeuw
Copy link
Contributor Author

I've create 5 pull requests instead.

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.

2 participants