11use super :: { ConnectionLike , Runtime } ;
22use crate :: aio:: setup_connection;
33use crate :: aio:: DisconnectNotifier ;
4+ use crate :: client:: GlideConnectionOptions ;
45use crate :: cmd:: Cmd ;
56#[ cfg( any( feature = "tokio-comp" , feature = "async-std-comp" ) ) ]
67use crate :: parser:: ValueCodec ;
78use crate :: push_manager:: PushManager ;
89use crate :: types:: { RedisError , RedisFuture , RedisResult , Value } ;
9- use crate :: { cmd, ConnectionInfo , ProtocolVersion , PushInfo , PushKind } ;
10+ use crate :: { cmd, ConnectionInfo , ProtocolVersion , PushKind } ;
1011use :: tokio:: {
1112 io:: { AsyncRead , AsyncWrite } ,
1213 sync:: { mpsc, oneshot} ,
@@ -416,8 +417,7 @@ impl MultiplexedConnection {
416417 pub async fn new < C > (
417418 connection_info : & ConnectionInfo ,
418419 stream : C ,
419- push_sender : Option < mpsc:: UnboundedSender < PushInfo > > ,
420- disconnect_notifier : Option < Box < dyn DisconnectNotifier > > ,
420+ glide_connection_options : GlideConnectionOptions ,
421421 ) -> RedisResult < ( Self , impl Future < Output = ( ) > ) >
422422 where
423423 C : Unpin + AsyncRead + AsyncWrite + Send + ' static ,
@@ -426,8 +426,7 @@ impl MultiplexedConnection {
426426 connection_info,
427427 stream,
428428 std:: time:: Duration :: MAX ,
429- push_sender,
430- disconnect_notifier,
429+ glide_connection_options,
431430 )
432431 . await
433432 }
@@ -438,8 +437,7 @@ impl MultiplexedConnection {
438437 connection_info : & ConnectionInfo ,
439438 stream : C ,
440439 response_timeout : std:: time:: Duration ,
441- push_sender : Option < mpsc:: UnboundedSender < PushInfo > > ,
442- disconnect_notifier : Option < Box < dyn DisconnectNotifier > > ,
440+ glide_connection_options : GlideConnectionOptions ,
443441 ) -> RedisResult < ( Self , impl Future < Output = ( ) > ) >
444442 where
445443 C : Unpin + AsyncRead + AsyncWrite + Send + ' static ,
@@ -457,10 +455,11 @@ impl MultiplexedConnection {
457455 let codec = ValueCodec :: default ( )
458456 . framed ( stream)
459457 . and_then ( |msg| async move { msg } ) ;
460- let ( mut pipeline, driver) = Pipeline :: new ( codec, disconnect_notifier) ;
458+ let ( mut pipeline, driver) =
459+ Pipeline :: new ( codec, glide_connection_options. disconnect_notifier ) ;
461460 let driver = boxed ( driver) ;
462461 let pm = PushManager :: default ( ) ;
463- if let Some ( sender) = push_sender {
462+ if let Some ( sender) = glide_connection_options . push_sender {
464463 pm. replace_sender ( sender) ;
465464 }
466465
0 commit comments