Commit Graph

263 Commits

Author SHA1 Message Date
Sean McArthur 5ec2979e83 impl Clone and Debug for Either 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
Sean McArthur d8e6d6499b
buffer: make Buffer::new infallible (#257)
Creating a buffer can internally fail to spawn a worker. Before, that
error was returned immediately from `Buffer::new`. This changes `new` to
always return a `Buffer`, and the spawn error is encountered via
`poll_ready`.
2019-04-22 13:06:20 -07:00
João Oliveira cc58745952 update doc examples (#259) 2019-04-22 10:55:14 -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 979c139912 MakeConnection: rename Request generic to Target (#250) 2019-04-10 15:11:11 -07:00
Sean McArthur 2a3a577929 change ServiceFn to use FnMut instead of Fn (#249) 2019-04-10 13:37:00 -07:00
Sean McArthur d1c891d1ba
Promote service_fn to tower crate (#248) 2019-04-10 13:17:16 -07:00
Lucio Franco 23ce9133b5 buffer: Move buffer to service.rs and layer to layer.rs (#246) 2019-04-10 12:35:05 -07:00
Sean McArthur 1012b20737
util: derive Clone for ServiceFn (#245) 2019-04-10 12:02:15 -07:00
Carl Lerche 0f58e50c3d
Rename `Chain` -> `Stack` (#239)
Reduce metaphors.

Fixes #233
2019-04-09 13:09:44 -07:00
Jake Shadle b42a365828 Add license field to all crates (#241) 2019-04-09 10:59:30 -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 ef6d203b47
Create `tower-test` and include tower-mock. (#237)
tower-mock is deleted in favor of having a single test crate. This crate
also includes a new macro: `assert_request_eq!`.
2019-04-07 20:42:18 -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 5ed014fc37
ci: include missing crates in CI run (#231) 2019-04-04 12:37:07 -07:00
Carl Lerche 971bb06152
Provide layer specific fns on `ServiceBuilder` (#227) 2019-04-03 20:40:06 -07:00
Oliver Gould aa8d024fc9
Support weighted balancing (#221)
In order to implement red-line testing, blue-green deployments, and
other operational use cases, many service discovery and routing schemes
support endpoint weighting.

In this iteration, we provide a decorator type, `WeightedLoad`, that may
be used to wrap load-bearing services to alter their load according to a
weight.  The `WithWeighted` type may also be used to wrap `Discover`
implementations, in which case it will wrap all new services with
`WeightedLoad`.
2019-04-03 19:59:46 -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
Lucio Franco 1fb42357f9
retry: Call poll_ready on the inner service (#223)
mock: Panic if poll_ready is not called
2019-04-02 17:53:24 -04:00
Carl Lerche d7516c3222
balance: minor cleanup (#220) 2019-03-29 19:17:21 -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 3fd5b581cc
Fix build. (#217)
A recently merged PR failed to track master.
2019-03-29 14:39:34 -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
Carl Lerche 2448ca9cdc
balance: cleanup example (#211) 2019-03-29 14:24:43 -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
Lucio Franco d968432183 Export all crates from the tower crate (#210) 2019-03-27 15:38:49 -07:00
Lucio Franco b01252c5e9
Fix tower-service-util docs link (#209) 2019-03-26 14:12:44 -04:00
Lucio Franco 7a09459081 Fix readme links (#208) 2019-03-26 08:46:53 -07:00
Lucio Franco 9dfcf7e527 Add tower to the readme (#207) 2019-03-26 08:38:00 -07:00
Lucio Franco 8f3a5ea6fa
Fix doc links for unpublished crates (#206) 2019-03-26 10:16:03 -04:00
Lucio Franco 476f085c89
Introduce the `ServiceBuilder` (#175)
The `ServiceBuilder` composes layers together and produces either a `MakeService` or a `Service` wrapped by those layers.
2019-03-26 10:14:42 -04:00
Carl Lerche bec3937e87
buffer: switch to TypedExecutor (#205) 2019-03-25 10:56:12 -07:00
Lucio Franco 0e70f1320e
layer: Add an identity layer (#195)
Tied to #175
2019-03-24 16:53:09 -04:00
Sean McArthur db2f0ecfb3
Introduce tower-load-shed (#204)
Provides a middleware that immediately fails any request if the
underlying service isn't ready yet. This is useful when used in
conjunction with `InFlightLimit` or others, so that requests are
rejected immediately, instead of keeping track of extra pending
requests.
2019-03-20 15:48:10 -07:00
Carl Lerche 5607313192
Minor `tower` crate re-org (#201)
- Rename `tower::ext` -> `tower::util`.
- Re-export structs from `tower-service-util` in `tower::util`.
- Re-export `tower_service::Service` at root.
2019-03-20 09:17:59 -07:00
Carl Lerche 263c680ea6 Remove tower-watch (#200) 2019-03-19 18:18:59 -07:00
Sean McArthur 1aba91313c
add poll_ready to MakeConnection (#202) 2019-03-19 18:18:07 -07:00
Carl Lerche 728f9d3c37
Fix fmt (#203) 2019-03-19 15:13:10 -07:00
Carl Lerche 733b597f38
Simplify Buffer::new error type
The returned error is now `Box<Error + Send + Sync>`.
2019-03-18 20:26:21 -07:00
Carl Lerche e05dc90340
Polish call all (#198)
- Move `CallAll` into `tower-service-util`
- Simplify error handling
- Add `CallAllUnordered`
2019-03-18 19:59:28 -07:00
Carl Lerche 92f4a0cb72
Rename tower-util -> tower (#197) 2019-03-15 10:53:19 -07:00
Carl Lerche fd54e47b56
rm tower-util/src/service_fn.rs (#196) 2019-03-14 19:51:50 -07:00