mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-26 00:01:33 +00:00
feat(swarm): deprecated keep_alive_timeout
from OneShotHandlerConfig
Related: #3844. Related: #4677 Pull-Request: #4680.
This commit is contained in:
@ -10,6 +10,8 @@
|
||||
Individual protocols should not keep connections alive for longer than necessary.
|
||||
Users should use `swarm::Config::idle_connection_timeout` instead.
|
||||
See [PR 4656](https://github.com/libp2p/rust-libp2p/pull/4656).
|
||||
- Deprecate `keep_alive_timeout` in `OneShotHandlerConfig`.
|
||||
See [PR 4680](https://github.com/libp2p/rust-libp2p/pull/4680).
|
||||
|
||||
[PR 4120]: https://github.com/libp2p/rust-libp2p/pull/4120
|
||||
|
||||
|
@ -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),
|
||||
|
Reference in New Issue
Block a user