feat(swarm): deprecated keep_alive_timeout from OneShotHandlerConfig

Related: #3844.
Related: #4677

Pull-Request: #4680.
This commit is contained in:
Leonz
2023-10-18 04:41:04 +08:00
committed by GitHub
parent 411824ad50
commit 203e11c1c8
2 changed files with 6 additions and 0 deletions

View File

@ -233,6 +233,9 @@ where
#[derive(Debug)]
pub struct OneShotHandlerConfig {
/// Keep-alive timeout for idle connections.
#[deprecated(
note = "Set a global idle connection timeout via `SwarmBuilder::idle_connection_timeout` instead."
)]
pub keep_alive_timeout: Duration,
/// Timeout for outbound substream upgrades.
pub outbound_substream_timeout: Duration,
@ -241,6 +244,7 @@ pub struct OneShotHandlerConfig {
}
impl Default for OneShotHandlerConfig {
#[allow(deprecated)]
fn default() -> Self {
OneShotHandlerConfig {
keep_alive_timeout: Duration::from_secs(10),