@@ -127,9 +127,9 @@ pub trait Receiver: Debug + Sealed {}
127127
128128/// Trait to specify channels for a message and service
129129pub trait Channels < S : Service > {
130- /// The sender type, can be either spsc , oneshot or none
130+ /// The sender type, can be either mpsc , oneshot or none
131131 type Tx : Sender ;
132- /// The receiver type, can be either spsc , oneshot or none
132+ /// The receiver type, can be either mpsc , oneshot or none
133133 ///
134134 /// For many services, the receiver is not needed, so it can be set to [`NoReceiver`].
135135 type Rx : Receiver ;
@@ -315,14 +315,14 @@ pub mod channel {
315315
316316 /// SPSC channel, similar to tokio's mpsc channel
317317 ///
318- /// For the rpc case, the send side can not be cloned, hence spsc instead of mpsc.
319- pub mod spsc {
318+ /// For the rpc case, the send side can not be cloned, hence mpsc instead of mpsc.
319+ pub mod mpsc {
320320 use std:: { fmt:: Debug , future:: Future , io, pin:: Pin , sync:: Arc } ;
321321
322322 use super :: { RecvError , SendError } ;
323323 use crate :: RpcMessage ;
324324
325- /// Create a local spsc sender and receiver pair, with the given buffer size.
325+ /// Create a local mpsc sender and receiver pair, with the given buffer size.
326326 ///
327327 /// This is currently using a tokio channel pair internally.
328328 pub fn channel < T > ( buffer : usize ) -> ( Sender < T > , Receiver < T > ) {
@@ -582,7 +582,7 @@ pub mod channel {
582582 impl crate :: Receiver for NoReceiver { }
583583 }
584584
585- /// Error when sending a oneshot or spsc message. For local communication,
585+ /// Error when sending a oneshot or mpsc message. For local communication,
586586 /// the only thing that can go wrong is that the receiver has been dropped.
587587 ///
588588 /// For rpc communication, there can be any number of errors, so this is a
@@ -608,7 +608,7 @@ pub mod channel {
608608 }
609609 }
610610
611- /// Error when receiving a oneshot or spsc message. For local communication,
611+ /// Error when receiving a oneshot or mpsc message. For local communication,
612612 /// the only thing that can go wrong is that the sender has been closed.
613613 ///
614614 /// For rpc communication, there can be any number of errors, so this is a
@@ -871,24 +871,24 @@ impl<M, R, S> Client<M, R, S> {
871871 }
872872 }
873873
874- /// Performs a request for which the server returns a spsc receiver.
874+ /// Performs a request for which the server returns a mpsc receiver.
875875 pub fn server_streaming < Req , Res > (
876876 & self ,
877877 msg : Req ,
878878 local_response_cap : usize ,
879- ) -> impl Future < Output = Result < channel:: spsc :: Receiver < Res > > > + Send + ' static
879+ ) -> impl Future < Output = Result < channel:: mpsc :: Receiver < Res > > > + Send + ' static
880880 where
881881 S : Service ,
882882 M : From < WithChannels < Req , S > > + Send + Sync + Unpin + ' static ,
883883 R : From < Req > + Serialize + Send + Sync + ' static ,
884- Req : Channels < S , Tx = channel:: spsc :: Sender < Res > , Rx = NoReceiver > + Send + ' static ,
884+ Req : Channels < S , Tx = channel:: mpsc :: Sender < Res > , Rx = NoReceiver > + Send + ' static ,
885885 Res : RpcMessage ,
886886 {
887887 let request = self . request ( ) ;
888888 async move {
889- let recv: channel:: spsc :: Receiver < Res > = match request. await ? {
889+ let recv: channel:: mpsc :: Receiver < Res > = match request. await ? {
890890 Request :: Local ( request) => {
891- let ( tx, rx) = channel:: spsc :: channel ( local_response_cap) ;
891+ let ( tx, rx) = channel:: mpsc :: channel ( local_response_cap) ;
892892 request. send ( ( msg, tx) ) . await ?;
893893 rx
894894 }
@@ -911,26 +911,26 @@ impl<M, R, S> Client<M, R, S> {
911911 local_update_cap : usize ,
912912 ) -> impl Future <
913913 Output = Result < (
914- channel:: spsc :: Sender < Update > ,
914+ channel:: mpsc :: Sender < Update > ,
915915 channel:: oneshot:: Receiver < Res > ,
916916 ) > ,
917917 >
918918 where
919919 S : Service ,
920920 M : From < WithChannels < Req , S > > + Send + Sync + Unpin + ' static ,
921921 R : From < Req > + Serialize + ' static ,
922- Req : Channels < S , Tx = channel:: oneshot:: Sender < Res > , Rx = channel:: spsc :: Receiver < Update > > ,
922+ Req : Channels < S , Tx = channel:: oneshot:: Sender < Res > , Rx = channel:: mpsc :: Receiver < Update > > ,
923923 Update : RpcMessage ,
924924 Res : RpcMessage ,
925925 {
926926 let request = self . request ( ) ;
927927 async move {
928928 let ( update_tx, res_rx) : (
929- channel:: spsc :: Sender < Update > ,
929+ channel:: mpsc :: Sender < Update > ,
930930 channel:: oneshot:: Receiver < Res > ,
931931 ) = match request. await ? {
932932 Request :: Local ( request) => {
933- let ( req_tx, req_rx) = channel:: spsc :: channel ( local_update_cap) ;
933+ let ( req_tx, req_rx) = channel:: mpsc :: channel ( local_update_cap) ;
934934 let ( res_tx, res_rx) = channel:: oneshot:: channel ( ) ;
935935 request. send ( ( msg, res_tx, req_rx) ) . await ?;
936936 ( req_tx, res_rx)
@@ -947,32 +947,32 @@ impl<M, R, S> Client<M, R, S> {
947947 }
948948 }
949949
950- /// Performs a request for which the client can send updates, and the server returns a spsc receiver.
950+ /// Performs a request for which the client can send updates, and the server returns a mpsc receiver.
951951 pub fn bidi_streaming < Req , Update , Res > (
952952 & self ,
953953 msg : Req ,
954954 local_update_cap : usize ,
955955 local_response_cap : usize ,
956- ) -> impl Future < Output = Result < ( channel:: spsc :: Sender < Update > , channel:: spsc :: Receiver < Res > ) > >
956+ ) -> impl Future < Output = Result < ( channel:: mpsc :: Sender < Update > , channel:: mpsc :: Receiver < Res > ) > >
957957 + Send
958958 + ' static
959959 where
960960 S : Service ,
961961 M : From < WithChannels < Req , S > > + Send + Sync + Unpin + ' static ,
962962 R : From < Req > + Serialize + Send + ' static ,
963- Req : Channels < S , Tx = channel:: spsc :: Sender < Res > , Rx = channel:: spsc :: Receiver < Update > >
963+ Req : Channels < S , Tx = channel:: mpsc :: Sender < Res > , Rx = channel:: mpsc :: Receiver < Update > >
964964 + Send
965965 + ' static ,
966966 Update : RpcMessage ,
967967 Res : RpcMessage ,
968968 {
969969 let request = self . request ( ) ;
970970 async move {
971- let ( update_tx, res_rx) : ( channel:: spsc :: Sender < Update > , channel:: spsc :: Receiver < Res > ) =
971+ let ( update_tx, res_rx) : ( channel:: mpsc :: Sender < Update > , channel:: mpsc :: Receiver < Res > ) =
972972 match request. await ? {
973973 Request :: Local ( request) => {
974- let ( update_tx, update_rx) = channel:: spsc :: channel ( local_update_cap) ;
975- let ( res_tx, res_rx) = channel:: spsc :: channel ( local_response_cap) ;
974+ let ( update_tx, update_rx) = channel:: mpsc :: channel ( local_update_cap) ;
975+ let ( res_tx, res_rx) = channel:: mpsc :: channel ( local_response_cap) ;
976976 request. send ( ( msg, res_tx, update_rx) ) . await ?;
977977 ( update_tx, res_rx)
978978 }
@@ -1120,7 +1120,7 @@ pub mod rpc {
11201120 channel:: {
11211121 none:: NoSender ,
11221122 oneshot,
1123- spsc :: { self , DynReceiver , DynSender } ,
1123+ mpsc :: { self , DynReceiver , DynSender } ,
11241124 RecvError , SendError ,
11251125 } ,
11261126 util:: { now_or_never, AsyncReadVarintExt , WriteVarintExt } ,
@@ -1290,9 +1290,9 @@ pub mod rpc {
12901290 }
12911291 }
12921292
1293- impl < T : RpcMessage > From < quinn:: RecvStream > for spsc :: Receiver < T > {
1293+ impl < T : RpcMessage > From < quinn:: RecvStream > for mpsc :: Receiver < T > {
12941294 fn from ( read : quinn:: RecvStream ) -> Self {
1295- spsc :: Receiver :: Boxed ( Box :: new ( QuinnReceiver {
1295+ mpsc :: Receiver :: Boxed ( Box :: new ( QuinnReceiver {
12961296 recv : read,
12971297 _marker : PhantomData ,
12981298 } ) )
@@ -1320,9 +1320,9 @@ pub mod rpc {
13201320 }
13211321 }
13221322
1323- impl < T : RpcMessage > From < quinn:: SendStream > for spsc :: Sender < T > {
1323+ impl < T : RpcMessage > From < quinn:: SendStream > for mpsc :: Sender < T > {
13241324 fn from ( write : quinn:: SendStream ) -> Self {
1325- spsc :: Sender :: Boxed ( Arc :: new ( QuinnSender ( tokio:: sync:: Mutex :: new (
1325+ mpsc :: Sender :: Boxed ( Arc :: new ( QuinnSender ( tokio:: sync:: Mutex :: new (
13261326 QuinnSenderState :: Open ( QuinnSenderInner {
13271327 send : write,
13281328 buffer : SmallVec :: new ( ) ,
0 commit comments