mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-04-25 11:02:12 +00:00
Re-export throttled
-specific response channel (#1902)
This commit is contained in:
parent
47c5c80433
commit
6a85eb46fc
@ -52,9 +52,10 @@ use super::{
|
|||||||
RequestResponseConfig,
|
RequestResponseConfig,
|
||||||
RequestResponseEvent,
|
RequestResponseEvent,
|
||||||
RequestResponseMessage,
|
RequestResponseMessage,
|
||||||
ResponseChannel
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub type ResponseChannel<R> = super::ResponseChannel<Message<R>>;
|
||||||
|
|
||||||
/// A wrapper around [`RequestResponse`] which adds request limits per peer.
|
/// A wrapper around [`RequestResponse`] which adds request limits per peer.
|
||||||
pub struct Throttled<C>
|
pub struct Throttled<C>
|
||||||
where
|
where
|
||||||
@ -304,7 +305,7 @@ where
|
|||||||
/// Answer an inbound request with a response.
|
/// Answer an inbound request with a response.
|
||||||
///
|
///
|
||||||
/// See [`RequestResponse::send_response`] for details.
|
/// See [`RequestResponse::send_response`] for details.
|
||||||
pub fn send_response(&mut self, ch: ResponseChannel<Message<C::Response>>, res: C::Response)
|
pub fn send_response(&mut self, ch: ResponseChannel<C::Response>, res: C::Response)
|
||||||
-> Result<(), C::Response>
|
-> Result<(), C::Response>
|
||||||
{
|
{
|
||||||
log::trace!("{:08x}: sending response {} to peer {}", self.id, ch.request_id(), &ch.peer);
|
log::trace!("{:08x}: sending response {} to peer {}", self.id, ch.request_id(), &ch.peer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user