Skip to content

Commit

Permalink
feat: expose current max {recv,send} stream count (#784)
Browse files Browse the repository at this point in the history
  • Loading branch information
dswij authored Jun 10, 2024
1 parent f161f7c commit 4617f49
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,16 @@ where
pub fn is_extended_connect_protocol_enabled(&self) -> bool {
self.inner.is_extended_connect_protocol_enabled()
}

/// Returns the current max send streams
pub fn current_max_send_streams(&self) -> usize {
self.inner.current_max_send_streams()
}

/// Returns the current max recv streams
pub fn current_max_recv_streams(&self) -> usize {
self.inner.current_max_recv_streams()
}
}

impl<B> fmt::Debug for SendRequest<B>
Expand Down
10 changes: 10 additions & 0 deletions src/proto/streams/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,16 @@ where
.send
.is_extended_connect_protocol_enabled()
}

pub fn current_max_send_streams(&self) -> usize {
let me = self.inner.lock().unwrap();
me.counts.max_send_streams()
}

pub fn current_max_recv_streams(&self) -> usize {
let me = self.inner.lock().unwrap();
me.counts.max_recv_streams()
}
}

impl<B> DynStreams<'_, B> {
Expand Down

0 comments on commit 4617f49

Please sign in to comment.