@@ -154,7 +154,7 @@ impl SharedState {
154154 request_id : protocol:: RequestId ,
155155 after_hibernation : bool ,
156156 ) -> Result < InFlightRequestCtx > {
157- let ( msg_tx, msg_rx) = mpsc:: channel ( 128 ) ;
157+ let ( msg_tx, msg_rx) = mpsc:: unbounded_channel ( ) ;
158158 let ( drop_tx, drop_rx) = watch:: channel ( None ) ;
159159
160160 let new = match self . in_flight_requests . entry_async ( request_id) . await {
@@ -206,7 +206,7 @@ impl SharedState {
206206 . await
207207 . context ( "request not in flight" ) ?;
208208
209- let ( msg_tx, msg_rx) = mpsc:: channel ( 128 ) ;
209+ let ( msg_tx, msg_rx) = mpsc:: unbounded_channel ( ) ;
210210 let ( drop_tx, drop_rx) = watch:: channel ( None ) ;
211211
212212 req. hibernate ( msg_tx, drop_tx) . await ;
@@ -288,7 +288,7 @@ impl Deref for SharedState {
288288}
289289
290290pub struct InFlightRequestCtx {
291- pub msg_rx : mpsc:: Receiver < protocol:: ToRivetTunnelMessageKind > ,
291+ pub msg_rx : mpsc:: UnboundedReceiver < protocol:: ToRivetTunnelMessageKind > ,
292292 /// Used to check if the request handler has been dropped.
293293 ///
294294 /// This is separate from `msg_rx` there may still be messages that need to be sent to the
@@ -676,7 +676,7 @@ impl InFlightRequest {
676676 async fn wake (
677677 & mut self ,
678678 receiver_subject : String ,
679- msg_tx : mpsc:: Sender < protocol:: ToRivetTunnelMessageKind > ,
679+ msg_tx : mpsc:: UnboundedSender < protocol:: ToRivetTunnelMessageKind > ,
680680 drop_tx : watch:: Sender < Option < MsgGcReason > > ,
681681 ) {
682682 self . receiver_subject = receiver_subject;
@@ -722,7 +722,7 @@ impl InFlightRequest {
722722 #[ tracing:: instrument( skip_all) ]
723723 async fn hibernate (
724724 & mut self ,
725- msg_tx : mpsc:: Sender < protocol:: ToRivetTunnelMessageKind > ,
725+ msg_tx : mpsc:: UnboundedSender < protocol:: ToRivetTunnelMessageKind > ,
726726 drop_tx : watch:: Sender < Option < MsgGcReason > > ,
727727 ) {
728728 let mut pending_tunnel_msgs = Vec :: new ( ) ;
@@ -816,7 +816,7 @@ impl InFlightRequest {
816816enum InFlightRequestState {
817817 Active {
818818 /// Sender for incoming messages to this request.
819- msg_tx : mpsc:: Sender < protocol:: ToRivetTunnelMessageKind > ,
819+ msg_tx : mpsc:: UnboundedSender < protocol:: ToRivetTunnelMessageKind > ,
820820 /// Used to check if the request handler has been dropped.
821821 drop_tx : watch:: Sender < Option < MsgGcReason > > ,
822822 last_pong : i64 ,
@@ -826,7 +826,7 @@ enum InFlightRequestState {
826826 PendingHibernation { hibernation_state : HibernationState } ,
827827 Hibernating {
828828 /// Sender for incoming messages to this request.
829- msg_tx : mpsc:: Sender < protocol:: ToRivetTunnelMessageKind > ,
829+ msg_tx : mpsc:: UnboundedSender < protocol:: ToRivetTunnelMessageKind > ,
830830 /// Used to check if the hibernation handler has been dropped.
831831 drop_tx : watch:: Sender < Option < MsgGcReason > > ,
832832 hibernation_state : HibernationState ,
@@ -853,7 +853,7 @@ pub struct PendingWebsocketMessage {
853853#[ tracing:: instrument( skip_all) ]
854854async fn forward_tunnel_message (
855855 receiver_subject : & str ,
856- msg_tx : & mpsc:: Sender < protocol:: ToRivetTunnelMessageKind > ,
856+ msg_tx : & mpsc:: UnboundedSender < protocol:: ToRivetTunnelMessageKind > ,
857857 mut msg : protocol:: ToRivetTunnelMessage ,
858858) -> Option < protocol:: ToRivetTunnelMessage > {
859859 // Send message to the request handler to emulate the real network action
@@ -869,7 +869,7 @@ async fn forward_tunnel_message(
869869 "forwarding message to request handler"
870870 ) ;
871871
872- if let Err ( send_err) = msg_tx. send ( msg. message_kind ) . await {
872+ if let Err ( send_err) = msg_tx. send ( msg. message_kind ) {
873873 tracing:: debug!(
874874 gateway_id=%protocol:: util:: id_to_string( & msg. message_id. gateway_id) ,
875875 request_id=%protocol:: util:: id_to_string( & msg. message_id. request_id) ,
0 commit comments