Commit Graph

57 Commits

Author SHA1 Message Date
Jon Gjengset 8df2a3e410
step 1: move all things to where they're going
Note that this also moves all crates from `log` to `tracing`.
It also does not set any dependencies as optional.
2020-03-31 13:31:21 -04:00
Jon Gjengset 52fde9767c
util: Add ReadyAnd to do what Ready should do (#427)
* util: Add ReadyAnd to do what Ready should do

`ServiceExt::ready` says that it produces "A future yielding the service
when it is ready to accept a request." This is not true; it does _not_
yield the service when it is ready, it yields unit. This makes it
impossible to chain service ready with service call, which is sad.

This PR adds `ready_and`, which does what `ready` promised. It also
deprecates `ready` with the intention that we remove `ready` in a future
version, and make the strictly more general `ready_and` take its place.
We can't do it now since it's not a backwards-compatible change even
though it _probably_ wouldn't break any code.

The PR also updates the docs so that they reflect the observed behavior.
2020-03-23 12:49:44 -04:00
Jon Gjengset 47c3a14560 tower: Prepare 0.3.1 release 2020-01-17 22:53:08 -05:00
Jon Gjengset ccfe7da592 tower: Allow opting out of tracing/log
This is of particular importance since the `log` feature of `tracing`
(currently) fails to compile if the `tracing` dependency is renamed.
Without a way to disable it in `tower`, any package that both depends on
`tower` **and** renames `tracing` in its dependencies is doomed.
2020-01-17 17:01:43 -05:00
Lucio Franco 86eef82d2f
Remove default features for futures dep (#399)
* Remove default features for futures dep

* Add missing alloc feature
2019-12-19 14:20:41 -05:00
Lucio Franco 1e87d7ca8b
Bump crates and changelog dates (#397) 2019-12-19 13:44:40 -05:00
Sean McArthur 1863304331 move ServiceExt to tower-util crate 2019-12-11 12:13:51 -08:00
Sean McArthur f130e5e113 tower-util: reduce dependencies, make call-all optional 2019-12-11 11:25:13 -08:00
Juan Alvarez 1843416dfe remove service, make and layer path deps (#382) 2019-12-06 11:59:56 -05:00
Lucio Franco e2f1a49cf3
Update the rest of the crates and upgrade ready cache to `std::f… (#379)
* Update hedge, filter, load, load-shed, and more

* Update ready cache

* Prepare release for ready-cache

* fix merge

* Update balance

* Prepare balance release
2019-12-05 14:21:47 -05:00
Lucio Franco 0d2a3778ad
Update `tower` and `tower-util` and prep for release (#378)
* Update tower and tower-util

* Prepare them for release

* fmt

* Get tower tests working
2019-12-04 22:48:43 -05:00
Jon Gjengset 2653f70884 Bumps for 0.3.0-alpha.2 (#355)
* Bump all to futures-* alpha.19

* Prepare for alpha.2 release

* Make tower-service also a path dep

* Use new tokio alpha
2019-09-30 18:56:26 -04:00
Jon Gjengset 6baf381879
Consistently apply deny/warn rules (#352)
This makes all tower subcrates have the following lints as warn (rather
than allow): `missing_docs`, `rust_2018_idioms`, `unreachable_pub`, and
`missing_debug_implementations`. In addition, it consistently applies
`deny(warning)` *only* under CI so that deprecations and macro changes in minor
version bumps in dependencies will never cause `tower` crates to stop
compiling, and so that tests can be run even if not all warnings have been
dealt with. See also https://github.com/rust-unofficial/patterns/blob/master/anti_patterns/deny-warnings.md

Note that `tower-reconnect` has the `missing_docs` lint disabled for now
since it contained _no_ documentation previously. Also note that this
patch does not add documentation to the various `new` methods, as they
are considered self-explanatory. They are instead marked as
`#[allow(missing_docs)]`.
2019-09-23 17:28:14 -04:00
Sean McArthur 52075f3c6f Update tower-make to tokio-io v0.2.0-alpha.5 2019-09-20 15:09:09 -07:00
Lucio Franco ca951d56f4
Prepare `tower-buffer` 0.3.0-alpha.1b release (#345)
* buffer: Fix unused Stream warning

* Prepare `tower-buffer` 0.3.0-alpha.1b release

* Update buffer version in balance
2019-09-14 12:47:38 -04:00
Lucio Franco 206f3d9941
Prepare `tower-buffer` 0.3.0-alpha.1a release (#343)
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
2019-09-13 16:36:35 -04:00
Lucio Franco 42376d484b
tower: Add date to changelog 2019-09-11 16:45:19 -04:00
Jon Gjengset 395889c763
Make Ready only take Service by reference (#340)
Rather than consuming `self` and returning `(Self, _)`. This did mean
that a few crates that depended on `Ready` to own the `Service` and
provide it once it was ready had to change to call `poll_ready`
directly. Which in turn meant adding in some PhantomData<Request> so
that the impl blocks wouldn't be under-constrainted. Take, for example:

```
impl<K, S: Service<Req>, Req> Future for UnreadyService<K, S>
```

would fail to compile with

```
error[E0207]: the type parameter `Req` is not constrained by the impl trait, self type, or predicates
```
2019-09-11 15:49:51 -04:00
Lucio Franco fb124a14f0
Pin all the alpha based dependencies (#339)
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
2019-09-11 13:57:27 -04:00
Jon Gjengset 4c1df65a75
cargo fmt 2019-09-11 10:30:41 -04:00
Jon Gjengset 0802ca2bce
Update tower-util and tower to std::future (#330)
This bumps tower-util and tower to 0.3.0-alpha.1
2019-09-10 14:51:07 -04:00
Lucio Franco 72219ce862
Prep buffer and tower release (#305)
* Prep buffer 0.1.1 release

* Prep release for tower 0.1.1
2019-07-19 14:21:07 -04:00
Oliver Gould b39a4881d8
builder: Add `into_inner` (#299)
When using a `ServiceBuilder`, it's not possible to obtain the
underlying `Layer` implementation.

Adding a `ServiceBuilder::into_inner` allows callers to retrieve this
field instead of only being able to build a `Service`.
2019-07-09 11:43:59 -07:00
Sean McArthur b9c2fea0fc Greatly improve Debug output of ServiceBuilder (#280) 2019-05-09 08:44:40 -07:00
Carl Lerche 716bafd922
chore: fix small errors in Cargo files 2019-04-26 22:31:07 -07:00
Carl Lerche 14f4259518
Prepare release (#273)
The following crates are to be released:

- tower
- tower-buffer
- tower-discover
- tower-layer
- tower-limit
- tower-load-shed
- tower-retry
- tower-service
- tower-test
- tower-timeout
- tower-util
2019-04-26 21:31:25 -07:00
Sean McArthur d0d6ed54cf unify/improve style of docs shown by facade 2019-04-23 14:08:51 -07:00
Sean McArthur 0cc6cc0c78 inline docs for re-exported crates in facade (#266) 2019-04-23 12:46:02 -07:00
Sean McArthur 484cbe7556 Remove `ServiceBuilder::make_service()` 2019-04-23 12:08:21 -07:00
Carl Lerche 91c8357db1
Remove tower/examples (#261)
The examples create a cyclical dependency between this repository and
tower-hyper. Examples are moved to https://github.com/tower-rs/examples.
2019-04-23 11:47:57 -07:00
Sean McArthur c339f4bf13 Remove reconnect from tower facade 2019-04-23 11:28:56 -07:00
Sean McArthur 57a866ee09 remove Service bounds on ServiceBuilder::service() 2019-04-22 13:34:38 -07:00
Carl Lerche 07baf63048 Remove bounds of `Service` from `Layer` 2019-04-22 13:34:38 -07:00
Alex Leong e15d49903a
Pin tower-hyper dep to a specific revision (#258)
Signed-off-by: Alex Leong <alex@buoyant.io>
2019-04-19 15:48:31 -07:00
Sean McArthur d1c891d1ba
Promote service_fn to tower crate (#248) 2019-04-10 13:17:16 -07:00
Carl Lerche 0f58e50c3d
Rename `Chain` -> `Stack` (#239)
Reduce metaphors.

Fixes #233
2019-04-09 13:09:44 -07:00
David Barsky 17860191d7 Move Tower to 2018 Edition (#238) 2019-04-08 20:11:09 -07:00
Carl Lerche 7769590f46
Remove balance and filter from tower (#240)
These two crates will need to be finished at a later time.
2019-04-08 14:49:24 -07:00
Carl Lerche 16f2d2b4fa
Consolidate `limit` layers (#235)
* Consolidate `limit` layers

- `InFlightLimit` and `RateLimit` are moved into `tower-limit` crate.
- `InFlightLimit` is renamed to `ConcurrencyLimit`.

Fixes #225
2019-04-05 20:08:43 -07:00
Carl Lerche 971bb06152
Provide layer specific fns on `ServiceBuilder` (#227) 2019-04-03 20:40:06 -07:00
Carl Lerche 298fe2cc12
Rename `ServiceBuilder` builder fns. (#228)
Closes #226
2019-04-03 19:33:28 -07:00
Lucio Franco 486c533989
tower: Reexport all layers and add layer::util mod (#224)
* tower: Reexport all layers and add layer::util mod

* Fix crate names and layerext
2019-04-03 12:12:11 -04:00
Carl Lerche 9983347392
re-export layers from `tower` crate. (#222) 2019-04-02 16:22:23 -07:00
Carl Lerche 83be955afe
Rename OptionService -> Optional (#219)
Other service implementations do not have the Service suffix.
2019-03-29 19:17:11 -07:00
Carl Lerche 117018f319
Rename `EitherService` -> `Either` (#218) 2019-03-29 19:17:02 -07:00
Carl Lerche 019129829c
Move layer::{LayerExt, Chain, Identity} (#216)
- `tower-layer` util types are now in `tower-util`.
- `LayerExt` is now in `tower`.

This sets the stage for adding layer specific extension fns.
2019-03-29 14:28:06 -07:00
Lucio Franco da4e22c89d
Add missing `TimeoutLayer` to tower (#215)
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
2019-03-29 17:00:13 -04:00
Carl Lerche f6dcbb6ca1
Remove combinators (#214) 2019-03-27 20:16:07 -07:00
Carl Lerche 3a407c2775
Move misc types (#213) 2019-03-27 19:56:44 -07:00
Carl Lerche f1bb22a296
util: rename tower-service-util -> tower-util (#212) 2019-03-27 16:34:56 -07:00