584 Commits

Author SHA1 Message Date
Carlos O'Ryan
954e4c7e8d
docs: bad documentation in ExponentialBackoffMaker (#809) 2024-12-27 11:42:55 +00:00
Jess Izen
34a6951a46
add ServiceBuilder::boxed_clone_sync helper (#804) 2024-12-20 18:34:40 -05:00
Sean McArthur
7dc533ef86 tower v0.5.2 tower-0.5.2 2024-12-11 08:25:54 -05:00
Bhuwan Pandit
a09fd9742d
chore: fix dead code warning for 'Sealed' trait and 'sample_floyd2' func (#799) 2024-12-10 14:47:18 -05:00
Jess Izen
f57e31b0e6
Add util::BoxCloneSyncServiceLayer (#802)
cc #777
2024-12-10 14:31:45 -05:00
tim gretler
da24532017
Add util::BoxCloneSyncService (#777)
Closes #770
2024-12-10 13:38:18 -05:00
Elichai Turkel
6283f3aff1
Upgrade http and sync_wrapper dependencies (#788) 2024-11-19 11:49:39 -05:00
Jonas Platte
71551010ac
Prepare release of v0.5.1 (#791) tower-0.5.1 2024-08-21 19:36:33 -04:00
Arnaud Gourlay
b2c48b46a3
Bump dependency on tower-layer (#787) 2024-08-15 14:03:34 +00:00
Toby Lawrence
fec9e559e2
tower-layer: drop versions from dev dependencies (#782) tower-layer-0.3.3 tower-0.5.0 2024-08-13 12:48:56 -04:00
David Barsky
646804d77e
chore: prepare to release tower-0.5.0, tower-layer-0.3.3, tower-service-0.3.3, and tower-test-0.4.1 (#781) tower-service-0.3.3 2024-08-02 15:21:30 -04:00
Dirk Stolle
7202cfeecd
chore: fix a few typos (#780) 2024-07-23 19:54:14 -04:00
Glen De Cauwsemaecker
85080a5617
use workspace dependencies for tower (#778)
Co-authored-by: Toby Lawrence <tobz@users.noreply.github.com>
2024-07-23 11:26:01 -04:00
Glen De Cauwsemaecker
88a7d3e01e
fix warnings found when running check/doc commands (#779)
Co-authored-by: Toby Lawrence <tobz@users.noreply.github.com>
2024-07-23 10:55:12 -04:00
Dirk Stolle
a6e98a7d69
chore: update GitHub Actions CI (#740) 2024-07-23 09:37:48 -04:00
Toby Lawrence
74e925d2c8
chore: fix spelling errors (#775)
Co-authored-by: Dirk Stolle <striezel-dev@web.de>
2024-07-21 12:36:46 -04:00
Daniél Kerkmann
89ac74f320
feat: Make new functions const when possible (#760)
* feat: Make new functions const when possible

The main reason was to allow to initialize the RateLimitLayer in a const context.
So why not making ever new function const (wherever it's possible). :P

* Change the assert to use an MSRV-compatible function.

---------

Co-authored-by: Toby Lawrence <tobz@users.noreply.github.com>
2024-07-20 13:18:29 -04:00
Glen De Cauwsemaecker
032d17f689
ensure that re-exported symbols show feature label in root (#754)
Co-authored-by: Toby Lawrence <tobz@users.noreply.github.com>
2024-07-20 13:11:02 -04:00
Josh Stone
05a0a25dcc
Upgrade to indexmap v2 (MSRV 1.63) (#741)
Co-authored-by: Toby Lawrence <tobz@users.noreply.github.com>
2024-07-20 13:01:30 -04:00
Glen De Cauwsemaecker
7d723eb2fa
remove generic parameters from Reconnect::new (#755)
these were not used, as the only parameters used
come from the impl block (directly and indirectly)

Co-authored-by: Toby Lawrence <tobz@users.noreply.github.com>
2024-07-20 12:42:34 -04:00
tottoto
f286933bec
chore: Remove unmatched deny ignore config (#733)
Co-authored-by: Toby Lawrence <tobz@users.noreply.github.com>
2024-07-20 12:31:24 -04:00
mxsm
08917603c1
docs: Fix some spelling mistakes (#747) 2024-07-19 16:27:07 -04:00
Eric Crosson
39adf5c509
docs: fix grammar (#749)
This commit uses the correct form of "it's".

"Its" is possessive describes a noun, while "it's" is a contraction that
is short for "it is". Since "ready" is not a noun, we must use the
contraction in this case.

In addition, this commit adds some missing commas.

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
2023-11-06 21:27:25 +00:00
0x5459
a4c20a388b chore: remove useless code 2023-11-06 16:12:37 -05:00
a-kenji
bf4ea94834
docs: Fix duplicate words in README (#734) 2023-05-16 19:34:51 +00:00
Misha Zharov
be1a4faf66
Check if must_use will fix the issue (#728) 2023-04-28 11:38:59 +02:00
qthree
0c3ae8856e
Derive Clone for AsyncFilterLayer (#731) 2023-04-21 15:25:52 +02:00
Misha Zharov
0604f20c48
Bump version numbers (#729) 2023-04-11 18:55:52 +02:00
Adrien Guillo
d2f1703c48
Derive Clone for RetryLayer (#726) 2023-03-24 21:59:48 +00:00
Spencer Bartholomew
664cb35abb
Fix axum readme link (#721) 2023-02-26 18:37:05 +01:00
Spencer Bartholomew
64182d8243
Recommend Axum instead of Warp (#720) 2023-02-26 15:46:02 +01:00
Jeffrey Hutchins
74881d5311
Copy editing building-a-middleware-from-scratch.md (#718) 2023-01-31 19:42:19 +01:00
Conrad Ludgate
b01bb12ddd
rng: use a simpler random 2-sampler (#716) 2023-01-10 12:11:30 -05:00
Frederik Haaning
6f3050614f
timeout: fix typo in docs (#711) 2022-12-01 11:06:11 -05:00
David Pedersen
c34182d0b3
util: make BoxService impl Sync via SyncWrapper (#702)
* util: make `BoxService` impl `Sync` via `SyncWrapper`

* changelog

* format
2022-11-27 10:09:18 +00:00
JJ Ferman
387d2844b7
Updating generic to be consistent (#710) 2022-11-09 08:02:13 +01:00
Alex Rudy
787f5dd81b
util: Adds a BoxCloneServiceLayer (#708)
This layer is similar to a BoxLayer, but produces a BoxCloneService instead, so can be used when
the underlying layers must be clone.

Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2022-11-04 11:06:23 -04:00
Leonardo Yvens
c9d84cde0c
util: Two call_all bug fixes (#709)
One is handling poll_ready errors (#706).

The other is fixing the TODO about disarming poll_ready, since there is no disarm this makes sure
`poll_ready` is only called if `call` will immediately follow.
2022-11-01 15:28:09 -04:00
boraarslan
d27ba65891
retry: Add Budget trait (#703) 2022-10-24 18:28:22 +00:00
Heiko Seeberger
582a0e0c74
util: improve ServiceExt::oneshot docs (#704) 2022-10-24 16:02:51 +00:00
Sam Lewis
c049ded33f
discover: Implement Clone for Change (#701)
Implements Clone for discover::Change, if the underlying key and value
both implement clone.

This is convenient for use-cases where a single change needs to be
duplicated, and sent to multiple discover streams.

Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2022-10-17 18:41:55 +00:00
Sam Lewis
7d829f198e
ready-cache: Allow iteration over ready services (#700)
Adds `iter_ready` and `iter_ready_mut` to allow iteration over ready
services within the ready_cache. This allows the ready cache to be used
for router-like services that wish to direct requests towards specific
services. Allowing iteration directly means that cache keys do not have
to be redundantly stored separate to the ready_cache.
2022-10-17 13:19:26 -04:00
Jonas Platte
87fa8ef782
layer: Implement Layer for tuples of up to 16 elements (#694) 2022-10-04 18:54:39 +00:00
Jonas Platte
3f31ffd2cf
chore: Use doc_auto_cfg (#693)
… so extra doc(cfg) attributes aren't needed in most places.
2022-09-25 16:03:54 +02:00
Daniel Cormier
c5632a26aa
docs(tower): moved docs from private tower::util::boxed module (#684)
Now they're on the public `BoxService` struct that referenced them.

Fixes #683.
2022-09-13 16:24:38 +00:00
Daniel Sedlak
4362dfc70c
retry: Extend Policy trait documentation (#690) 2022-09-12 11:33:20 -04:00
Lucio Franco
b12f14861f
retry: Add generic backoff utilities (#685)
This adds a new `Backoff` trait and a `ExponentialBackoff`
implementation borrwoed from `linkerd2-proxy`. This provides the initial
building blocks for a more fully batteries included retry policy.
2022-08-30 13:59:17 -04:00
Andrew Banchich
b6b0f27197
Remove lspower due to deprecation (#688) 2022-08-30 11:58:36 -04:00
Lucio Franco
e0558266a3
util: Add rng utilities (#686)
This adds new PRNG utilities that only use libstd and not the external
`rand` crate. This change's motivation are that in tower middleware that
need PRNG don't need the complexity and vast utilities of the `rand`
crate.

This adds a `Rng` trait which abstracts the simple PRNG features tower
needs. This also provides a `HasherRng` which uses the `RandomState`
type from libstd to generate random `u64` values. In addition, there is
an internal only `sample_inplace` which is used within the balance p2c
middleware to randomly pick a ready service. This implementation is
crate private since its quite specific to the balance implementation.

The goal of this in addition to the balance middlware getting `rand`
removed is for the upcoming `Retry` changes. The `next_f64` will be used
in the jitter portion of the backoff utilities in #685.

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
2022-08-25 13:06:24 -04:00
Lucio Franco
aec7b8f417
retry: Change Policy to accept &mut self (#681)
This changes the `Policy` trait in the `retry` layer to accept `&mut
self` instead of `&self` and changes the output type of the returned
future to `()`. The motivation for this change is to simplify
the trait a bit. By the trait methods having mutable references it means
that for each retry request session you can mutate the local policy.
This is because the policy is cloned for each individual request that
arrives into the retry middleware. In addition, this allows the `Policy`
trait to be object safe.
2022-08-23 14:30:09 -04:00