Pārlūkot izejas kodu

Streamer: cleanup API after QoS refactoring (#8724)

Addressed a few comments from Kirill
Lijun Wang 3 nedēļas atpakaļ
vecāks
revīzija
217ff3cd72

+ 1 - 2
streamer/src/nonblocking/qos.rs

@@ -21,8 +21,7 @@ pub(crate) trait QosController<C: ConnectionContext> {
     fn build_connection_context(&self, connection: &Connection) -> C;
 
     /// Try to add a new connection to the connection table. This is an async operation that
-    /// returns a Future. If successful, the Future resolves to Some containing a CancellationToken
-    /// and a ConnectionStreamCounter to track the streams created on this connection.
+    /// returns a Future. If successful, the Future resolves to Some containing a CancellationToken.
     /// Otherwise, the Future resolves to None.
     fn try_add_connection(
         &self,

+ 2 - 2
streamer/src/nonblocking/quic.rs

@@ -226,8 +226,8 @@ where
         keypair,
         packet_sender,
         quic_server_params,
-        cancel,
         swqos,
+        cancel,
     )
 }
 
@@ -239,8 +239,8 @@ pub(crate) fn spawn_server_with_cancel_and_qos<Q, C>(
     keypair: &Keypair,
     packet_sender: Sender<PacketBatch>,
     quic_server_params: QuicStreamerConfig,
-    cancel: CancellationToken,
     qos: Arc<Q>,
+    cancel: CancellationToken,
 ) -> Result<SpawnNonBlockingServerResult, QuicServerError>
 where
     Q: QosController<C> + Send + Sync + 'static,

+ 4 - 4
streamer/src/quic.rs

@@ -792,8 +792,8 @@ fn spawn_server_with_cancel_generic<Q, C>(
     keypair: &Keypair,
     packet_sender: Sender<PacketBatch>,
     quic_server_params: QuicStreamerConfig,
-    cancel: CancellationToken,
     qos: Arc<Q>,
+    cancel: CancellationToken,
 ) -> Result<SpawnServerResult, QuicServerError>
 where
     Q: QosController<C> + Send + Sync + 'static,
@@ -809,8 +809,8 @@ where
             keypair,
             packet_sender,
             quic_server_params,
-            cancel,
             qos,
+            cancel,
         )
     }?;
     let handle = thread::Builder::new()
@@ -861,8 +861,8 @@ pub fn spawn_server_with_cancel(
         keypair,
         packet_sender,
         quic_server_params,
-        cancel,
         swqos,
+        cancel,
     )
 }
 
@@ -897,8 +897,8 @@ pub fn spawn_simple_qos_server_with_cancel(
         keypair,
         packet_sender,
         quic_server_params,
-        cancel,
         simple_qos,
+        cancel,
     )
 }