Skip to content

Commit

Permalink
feat: add Connection::has_streams() for server connections (#838)
Browse files Browse the repository at this point in the history
Co-authored-by: luka <[email protected]>
  • Loading branch information
BamLubi and luka authored Feb 24, 2025
1 parent 2dc3078 commit a5d77c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/proto/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ where
}
}

/// Checks if there are any streams
pub fn has_streams(&self) -> bool {
self.inner.streams.has_streams()
}

/// Checks if there are any streams or references left
pub fn has_streams_or_other_references(&self) -> bool {
// If we poll() and realize that there are no streams or references
Expand Down
5 changes: 5 additions & 0 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,11 @@ where
self.connection.take_user_pings().map(PingPong::new)
}

/// Checks if there are any streams
pub fn has_streams(&self) -> bool {
self.connection.has_streams()
}

/// Returns the maximum number of concurrent streams that may be initiated
/// by the server on this connection.
///
Expand Down

0 comments on commit a5d77c2

Please sign in to comment.