|
2 | 2 | // SPDX-License-Identifier: Apache-2.0 |
3 | 3 |
|
4 | 4 | //! # Adaptative concurrency |
5 | | -//! This module provide [AdaptiveLimiter] as a tool to allow concurrency. |
6 | | -//! It's implemented with a Additive increase, Multiplicative decrease |
| 5 | +//! This module provides [AdaptiveLimiter] as a tool to allow concurrency. |
| 6 | +//! It's implemented with an Additive increase, Multiplicative decrease |
7 | 7 | //! ([AIMD](https://en.wikipedia.org/wiki/Additive_increase/multiplicative_decrease)) |
8 | 8 | //! strategy. |
9 | 9 | //! |
10 | 10 | //! |
11 | 11 | //! |
12 | 12 | //! This allows us to have a big number of rav requests running |
13 | | -//! concurrently, but in case of any of them fails, we limit |
| 13 | +//! concurrently, but if any of them fails we limit |
14 | 14 | //! the following requests until the aggregator recovers. |
15 | 15 | //! |
16 | 16 | //! ## Behaviour |
17 | | -//! On every request, the caller acquires a slot by calling [AdaptiveLimiter::acquire()], |
18 | | -//! this will increment the number of in_flight connections. |
| 17 | +//! On every request, the caller acquires a slot by calling [AdaptiveLimiter::acquire()]. |
| 18 | +//! This will increment the number of in_flight connections. |
19 | 19 | //! |
20 | 20 | //! If we receive a successful response, we increment our limit to be able to process |
21 | 21 | //! one more request concurrently. |
22 | 22 | //! |
23 | | -//! If we receive a failed response, we decrement our limit by half so quickly |
| 23 | +//! If we receive a failed response, we decrement our limit by half to quickly |
24 | 24 | //! relieve the pressure in the system. |
25 | 25 |
|
26 | 26 | use std::ops::Range; |
|
0 commit comments