mirror of
https://github.com/tower-rs/tower.git
synced 2025-10-02 07:20:52 +00:00

This branch updates Tower to depend on Tokio v1.0. In particular, the following changes were necessary: * `tokio::sync::Semaphore` now has a `close` operation, so permit acquisition is fallible. Our uses of the semaphore are updated to handle this. Also, this allows removing the janky homemade implementation of closing semaphores by adding a big pile of permits! * `tokio::sync`'s channels are no longer `Stream`s. This necessitated a few changes: - Replacing a few explicit `poll_next` calls with `poll_recv` - Updating some tests that used `mpsc::Receiver` as a `Stream` to add a wrapper type that makes it a `Stream` - Updating `CallAll`'s examples (I changed it to just use a `futures::channel` MPSC) * `tokio::time::Sleep` is no longer `Unpin`. Therefore, the rate-limit `Service` needs to `Box::pin` it. To avoid the overhead of allocating/deallocating `Box`es every time the rate limit is exhausted, I moved the `Sleep` out of the `State` enum and onto the `Service` struct, and changed the code to `reset` it every time the service is rate-limited. This way, we only allocate the box once when the service is created. There should be no actual changes in functionality. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Tower
Tower is a library of modular and reusable components for building robust networking clients and servers.
Overview
Tower aims to make it as easy as possible to build robust networking clients and servers. It is protocol agnostic, but is designed around a request / response pattern. If your protocol is entirely stream based, Tower may not be a good fit.
Status
Currently, tower 0.3
is released on crates. We are currently working on cleaning
up the codebase and adding more documentation. You can follow our progress in
this issue.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tower by you, shall be licensed as MIT, without any additional terms or conditions.
Description
Languages
Rust
100%