Skip to content

Commit f030b15

Browse files
tomakathomaseizingermxinden
authored
protocols/request-response: Remove throttled module (#2236)
Co-authored-by: Thomas Eizinger <thomas@eizinger.io> Co-authored-by: Max Inden <mail@max-inden.de>
1 parent 3c0f5c7 commit f030b15

File tree

6 files changed

+5
-1236
lines changed

6 files changed

+5
-1236
lines changed

protocols/request-response/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
- Manually implement `Debug` for `RequestResponseHandlerEvent` and
99
`RequestProtocol`. See [PR 2183].
1010

11+
- Remove `RequestResponse::throttled` and the `throttled` module.
12+
See [PR 2236].
13+
1114
[PR 2183]: https://github.com/libp2p/rust-libp2p/pull/2183
15+
[PR 2236]: https://github.com/libp2p/rust-libp2p/pull/2236
1216

1317
# 0.12.0 [2021-07-12]
1418

protocols/request-response/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ libp2p-core = { version = "0.30.0", path = "../../core", default-features = fals
1717
libp2p-swarm = { version = "0.31.0", path = "../../swarm" }
1818
log = "0.4.11"
1919
lru = "0.6"
20-
minicbor = { version = "0.11", features = ["std", "derive"] }
2120
rand = "0.7"
2221
smallvec = "1.6.1"
2322
unsigned-varint = { version = "0.7", features = ["std", "futures"] }

protocols/request-response/src/lib.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@
5858
5959
pub mod codec;
6060
pub mod handler;
61-
pub mod throttled;
6261

6362
pub use codec::{ProtocolName, RequestResponseCodec};
6463
pub use handler::ProtocolSupport;
65-
pub use throttled::Throttled;
6664

6765
use futures::channel::oneshot;
6866
use handler::{RequestProtocol, RequestResponseHandler, RequestResponseHandlerEvent};
@@ -248,11 +246,6 @@ impl<TResponse> ResponseChannel<TResponse> {
248246
pub fn is_open(&self) -> bool {
249247
!self.sender.is_canceled()
250248
}
251-
252-
/// Get the ID of the inbound request waiting for a response.
253-
pub(crate) fn request_id(&self) -> RequestId {
254-
self.request_id
255-
}
256249
}
257250

258251
/// The ID of an inbound or outbound request.
@@ -369,19 +362,6 @@ where
369362
}
370363
}
371364

372-
/// Creates a `RequestResponse` which limits requests per peer.
373-
///
374-
/// The behaviour is wrapped in [`Throttled`] and detects the limits
375-
/// per peer at runtime which are then enforced.
376-
pub fn throttled<I>(c: TCodec, protos: I, cfg: RequestResponseConfig) -> Throttled<TCodec>
377-
where
378-
I: IntoIterator<Item = (TCodec::Protocol, ProtocolSupport)>,
379-
TCodec: Send,
380-
TCodec::Protocol: Sync,
381-
{
382-
Throttled::new(c, protos, cfg)
383-
}
384-
385365
/// Initiates sending a request.
386366
///
387367
/// If the targeted peer is currently not connected, a dialing

0 commit comments

Comments
 (0)