File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed
src/protocol/notification Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -203,24 +203,21 @@ impl Stream for Connection {
203203 loop {
204204 let notification = match this. next_notification . take ( ) {
205205 Some ( notification) => Some ( notification) ,
206- None => {
207- let future = async {
208- tokio:: select! {
209- notification = this. async_rx. recv( ) => notification,
210- notification = this. sync_rx. recv( ) => notification,
211- }
212- } ;
213- futures:: pin_mut!( future) ;
214-
215- match future. poll_unpin ( cx) {
216- Poll :: Pending => None ,
206+ None => match this. async_rx . poll_recv ( cx) {
207+ Poll :: Ready ( Some ( notification) ) => Some ( notification) ,
208+ Poll :: Ready ( None ) =>
209+ return Poll :: Ready ( Some ( ConnectionEvent :: CloseConnection {
210+ notify : NotifyProtocol :: Yes ,
211+ } ) ) ,
212+ Poll :: Pending => match this. sync_rx . poll_recv ( cx) {
213+ Poll :: Ready ( Some ( notification) ) => Some ( notification) ,
217214 Poll :: Ready ( None ) =>
218215 return Poll :: Ready ( Some ( ConnectionEvent :: CloseConnection {
219216 notify : NotifyProtocol :: Yes ,
220217 } ) ) ,
221- Poll :: Ready ( Some ( notification ) ) => Some ( notification ) ,
222- }
223- }
218+ Poll :: Pending => None ,
219+ } ,
220+ } ,
224221 } ;
225222
226223 let Some ( notification) = notification else {
You can’t perform that action at this time.
0 commit comments