mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-27 16:51:34 +00:00
refactor(swarm): don't use task_event_buffer_size
for pending connections (#3187)
The task for a pending connection only ever sends one event into this channel: Either a success or a failure. Cloning a sender adds one slot to the capacity of the channel. Hence, we can start this capacity at 0 and have the `cloning` of the `Sender` take care of properly increasing the capacity.
This commit is contained in:
@ -319,8 +319,7 @@ where
|
||||
{
|
||||
/// Creates a new empty `Pool`.
|
||||
pub fn new(local_id: PeerId, config: PoolConfig, limits: ConnectionLimits) -> Self {
|
||||
let (pending_connection_events_tx, pending_connection_events_rx) =
|
||||
mpsc::channel(config.task_event_buffer_size);
|
||||
let (pending_connection_events_tx, pending_connection_events_rx) = mpsc::channel(0);
|
||||
let (established_connection_events_tx, established_connection_events_rx) =
|
||||
mpsc::channel(config.task_event_buffer_size);
|
||||
let executor = match config.executor {
|
||||
|
Reference in New Issue
Block a user