From 8febd5958892a0edc3af8d59bd2ff6ba40ddb03d Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Thu, 27 Feb 2020 12:18:38 +0000 Subject: [PATCH] Changed LocalBoxFuture to BoxFuture in reconnector (adds Send requirement) --- .../src/connection_manager/reconnector.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/clients/multi-tcp-client/src/connection_manager/reconnector.rs b/common/clients/multi-tcp-client/src/connection_manager/reconnector.rs index 5017637d10..666e156f99 100644 --- a/common/clients/multi-tcp-client/src/connection_manager/reconnector.rs +++ b/common/clients/multi-tcp-client/src/connection_manager/reconnector.rs @@ -1,4 +1,4 @@ -use futures::future::LocalBoxFuture; +use futures::future::BoxFuture; use futures::FutureExt; use log::*; use std::future::Future; @@ -10,7 +10,7 @@ use std::time::Duration; pub(crate) struct ConnectionReconnector<'a> { address: SocketAddr, - connection: LocalBoxFuture<'a, io::Result>, + connection: BoxFuture<'a, io::Result>, current_retry_attempt: u32, @@ -28,7 +28,7 @@ impl<'a> ConnectionReconnector<'a> { ) -> ConnectionReconnector<'a> { ConnectionReconnector { address, - connection: tokio::net::TcpStream::connect(address).boxed_local(), + connection: tokio::net::TcpStream::connect(address).boxed(), current_backoff_delay: tokio::time::delay_for(Duration::new(0, 0)), // if we can re-establish connection on first try without any backoff that's perfect current_retry_attempt: 0, maximum_reconnection_backoff, @@ -68,7 +68,7 @@ impl<'a> Future for ConnectionReconnector<'a> { self.current_backoff_delay .reset(tokio::time::Instant::now() + next_delay); - self.connection = tokio::net::TcpStream::connect(self.address).boxed_local(); + self.connection = tokio::net::TcpStream::connect(self.address).boxed(); Poll::Pending }