Skip to content

Commit fdf9586

Browse files
Expose the acceptor runtime (#2778)
1 parent 26e2402 commit fdf9586

File tree

1 file changed

+9
-0
lines changed
  • dc/s2n-quic-dc/src/stream/server

1 file changed

+9
-0
lines changed

dc/s2n-quic-dc/src/stream/server/tokio.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ impl<H: Handshake + Clone, S: event::Subscriber + Clone> Server<H, S> {
7575
&self.handshake
7676
}
7777

78+
/// Should generally only be used for advanced users.
79+
///
80+
/// This should not be used for spawning heavy-weight work (e.g., request processing), and is
81+
/// generally best used for tiny tasks which intermediate to some other runtime. For example,
82+
/// it can work well for having some small processing to then send into another channel.
83+
pub fn acceptor_rt(&self) -> tokio::runtime::Handle {
84+
(*self.acceptor_rt).clone()
85+
}
86+
7887
#[inline]
7988
pub async fn accept(&self) -> io::Result<(crate::stream::application::Stream<S>, SocketAddr)> {
8089
accept::accept(&self.streams, &self.stats).await

0 commit comments

Comments
 (0)