pub(crate) async fn check_out(
        &self,
        logical_session_timeout: Option<Duration>,
    ) -> ServerSession {
        let mut pool = self.pool.lock().await;
        while let Some(session) = pool.pop_front() {
            // If a session is about to expire within the next minute, remove it from pool.
            if session.is_about_to_expire(logical_session_timeout) {
                continue;
            }
            return session;
        }
        ServerSession::new()
    }
/// Checks out a server session from the pool. Before doing so, it first clears out all the
/// expired sessions. If there are no sessions left in the pool after clearing expired ones
/// out, a new session will be created.
Checks out a server session from the pool. Before doing so, it first clears out all the
expired sessions. If there are no sessions left in the pool after clearing expired ones
out, a new session will be created.
Checks out a server session from the pool . Before doing so it first clears out all the expired sessions . If there are no sessions left in the pool after clearing expired ones out a new session will be created .
pub(crate) async fn check_out(
        &self,
        logical_session_timeout: Option<Duration>,
    ) -> ServerSession {
        let mut pool = self.pool.lock().await;
        while let Some(session) = pool.pop_front() {
            // If a session is about to expire within the next minute, remove it from pool.
            if session.is_about_to_expire(logical_session_timeout) {
                continue;
            }
            return session;
        }
        ServerSession::new()
    }
pub ( crate ) async fn check_out ( & self , logical_session_timeout : Option < Duration > , ) -> ServerSession { let mut pool = self . pool . lock ( ) . await ; while let Some ( session ) = pool . pop_front ( ) { // If a session is about to expire within the next minute, remove it from pool. if session . is_about_to_expire ( logical_session_timeout ) { continue ; } return session ; } ServerSession :: new ( ) }
Checks out a server session from the pool.
Checks out a server session from the pool .
&self
logical_session_timeout
Option<Duration>
&self
logical_session_timeout
Option<Duration>