Skip to content

Commit bb13c10

Browse files
committed
feat: expose current max {recv,send} stream count
1 parent f161f7c commit bb13c10

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/client.rs

+10
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,16 @@ where
548548
pub fn is_extended_connect_protocol_enabled(&self) -> bool {
549549
self.inner.is_extended_connect_protocol_enabled()
550550
}
551+
552+
/// Returns the current max send streams
553+
pub fn current_max_send_streams(&self) -> usize {
554+
self.inner.current_max_send_streams()
555+
}
556+
557+
/// Returns the current max recv streams
558+
pub fn current_max_recv_streams(&self) -> usize {
559+
self.inner.current_max_recv_streams()
560+
}
551561
}
552562

553563
impl<B> fmt::Debug for SendRequest<B>

src/proto/streams/streams.rs

+10
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,16 @@ where
320320
.send
321321
.is_extended_connect_protocol_enabled()
322322
}
323+
324+
pub fn current_max_send_streams(&self) -> usize {
325+
let me = self.inner.lock().unwrap();
326+
me.counts.max_send_streams()
327+
}
328+
329+
pub fn current_max_recv_streams(&self) -> usize {
330+
let me = self.inner.lock().unwrap();
331+
me.counts.max_recv_streams()
332+
}
323333
}
324334

325335
impl<B> DynStreams<'_, B> {

0 commit comments

Comments
 (0)