Skip to content

Commit

Permalink
docs: add "Building a middleware from scratch" guide (#590)
Browse files Browse the repository at this point in the history
This adds a guide that explains how to implement a middleware from scratch without taking any shortcuts. It walks through implementing `Timeout` as it exists in Tower today.

The hope is that once users have read [the previous guide](https://tokio.rs/blog/2021-05-14-inventing-the-service-trait) followed by this one they should be fully equipped to implement their own middleware.
  • Loading branch information
davidpdrsn authored Jun 7, 2021
1 parent 31dbc90 commit 7776019
Show file tree
Hide file tree
Showing 2 changed files with 678 additions and 0 deletions.
4 changes: 4 additions & 0 deletions guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ widely known protocol, and one of Tower's more common use-cases.
fundamental [`Service`] trait could be designed from scratch. If you have no
experience with Tower and want to learn the absolute basics, this is where you
should start.
- ["Building a middleware from scratch"][build] walks through how to build the
[`Timeout`] middleware as it exists in Tower today, without taking any shortcuts.

[async-book]: https://rust-lang.github.io/async-book/
[tokio-tutorial]: https://tokio.rs/tokio/tutorial
[invent]: https://tokio.rs/blog/2021-05-14-inventing-the-service-trait
[build]: https://github.com/tower-rs/tower/blob/master/guides/building-a-middleware-from-scratch.md
[`Service`]: https://docs.rs/tower/latest/tower/trait.Service.html
[`Timeout`]: https://docs.rs/tower/latest/tower/timeout/struct.Timeout.html
Loading

0 comments on commit 7776019

Please sign in to comment.