Skip to content

Commit

Permalink
Revert "Disable backpressure"
Browse files Browse the repository at this point in the history
This reverts commit dadd0f5.
  • Loading branch information
boris-sinyapkin committed May 18, 2024
1 parent dadd0f5 commit b520d07
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ pub async fn establish_tcp_connection_with_opts(endpoint: &Address, tcp_opts: &T
Ok(tcp_stream)
}

#[allow(unused_imports, unused_variables)]
pub mod listener {

use super::connection::{LurkTcpConnection, LurkTcpConnectionFactory, LurkTcpConnectionLabel};
Expand All @@ -69,7 +68,7 @@ pub mod listener {
/// Custom implementation of TCP listener.
#[allow(dead_code)]
pub struct LurkTcpListener {
incoming: TcpListenerStream,
incoming: Backpressure<TcpListenerStream>,
factory: LurkTcpConnectionFactory,
local_addr: SocketAddr,
}
Expand All @@ -87,7 +86,7 @@ pub mod listener {

// Create backpressure limit and supply the receiver to the created stream.
let (bp_tx, bp_rx) = backpressure::new(conn_limit);
let incoming = TcpListenerStream::new(listener);
let incoming = TcpListenerStream::new(listener).apply_backpressure(bp_rx);

Ok(LurkTcpListener {
incoming,
Expand Down Expand Up @@ -132,7 +131,6 @@ pub mod listener {
/// should put on hold some of them and handle only allowed number of
/// them in parallel.
#[tokio::test]
#[ignore]

async fn limit_tcp_connections() {
let conn_limit = 5;
Expand Down

0 comments on commit b520d07

Please sign in to comment.