Skip to content

Commit 2bc2acc

Browse files
apollo_network: added sqmr Config docs (#8958)
1 parent ec6a412 commit 2bc2acc

File tree

1 file changed

+30
-0
lines changed
  • crates/apollo_network/src/sqmr

1 file changed

+30
-0
lines changed

crates/apollo_network/src/sqmr/mod.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,38 @@ pub enum GenericEvent<SessionError> {
196196
},
197197
}
198198

199+
/// Configuration parameters for the SQMR protocol.
200+
///
201+
/// This struct contains the configuration settings that control the behavior
202+
/// of SQMR sessions, including timeout values and other protocol parameters.
203+
///
204+
/// # Examples
205+
///
206+
/// ```rust
207+
/// use std::time::Duration;
208+
///
209+
/// use apollo_network::sqmr::Config;
210+
///
211+
/// // Create custom configuration
212+
/// let config = Config { session_timeout: Duration::from_secs(120) };
213+
///
214+
/// // Or use default values
215+
/// let default_config = Config::default();
216+
/// ```
199217
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
200218
pub struct Config {
219+
/// Maximum duration a session can remain active before timing out.
220+
///
221+
/// This timeout applies to both inbound and outbound sessions. Sessions
222+
/// that exceed this duration will be automatically terminated to prevent
223+
/// resource leaks and ensure system responsiveness.
224+
///
225+
/// ```
226+
/// # use apollo_network::sqmr::Config;
227+
/// # use std::time::Duration;
228+
/// let config = Config::default();
229+
/// assert_eq!(config.session_timeout, Duration::from_secs(10));
230+
/// ```
201231
pub session_timeout: Duration,
202232
}
203233

0 commit comments

Comments
 (0)