Skip to content

Commit

Permalink
feat: expose 'streams check' for Connection
Browse files Browse the repository at this point in the history
  • Loading branch information
luka committed Feb 20, 2025
1 parent 2dc3078 commit 66bcf8d
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 66bcf8d

Please sign in to comment.