1
1
use super :: { ConnectionLike , Runtime } ;
2
2
use crate :: aio:: setup_connection;
3
3
use crate :: aio:: DisconnectNotifier ;
4
+ use crate :: client:: GlideConnectionOptions ;
4
5
use crate :: cmd:: Cmd ;
5
6
#[ cfg( any( feature = "tokio-comp" , feature = "async-std-comp" ) ) ]
6
7
use crate :: parser:: ValueCodec ;
7
8
use crate :: push_manager:: PushManager ;
8
9
use crate :: types:: { RedisError , RedisFuture , RedisResult , Value } ;
9
- use crate :: { cmd, ConnectionInfo , ProtocolVersion , PushInfo , PushKind } ;
10
+ use crate :: { cmd, ConnectionInfo , ProtocolVersion , PushKind } ;
10
11
use :: tokio:: {
11
12
io:: { AsyncRead , AsyncWrite } ,
12
13
sync:: { mpsc, oneshot} ,
@@ -416,8 +417,7 @@ impl MultiplexedConnection {
416
417
pub async fn new < C > (
417
418
connection_info : & ConnectionInfo ,
418
419
stream : C ,
419
- push_sender : Option < mpsc:: UnboundedSender < PushInfo > > ,
420
- disconnect_notifier : Option < Box < dyn DisconnectNotifier > > ,
420
+ glide_connection_options : GlideConnectionOptions ,
421
421
) -> RedisResult < ( Self , impl Future < Output = ( ) > ) >
422
422
where
423
423
C : Unpin + AsyncRead + AsyncWrite + Send + ' static ,
@@ -426,8 +426,7 @@ impl MultiplexedConnection {
426
426
connection_info,
427
427
stream,
428
428
std:: time:: Duration :: MAX ,
429
- push_sender,
430
- disconnect_notifier,
429
+ glide_connection_options,
431
430
)
432
431
. await
433
432
}
@@ -438,8 +437,7 @@ impl MultiplexedConnection {
438
437
connection_info : & ConnectionInfo ,
439
438
stream : C ,
440
439
response_timeout : std:: time:: Duration ,
441
- push_sender : Option < mpsc:: UnboundedSender < PushInfo > > ,
442
- disconnect_notifier : Option < Box < dyn DisconnectNotifier > > ,
440
+ glide_connection_options : GlideConnectionOptions ,
443
441
) -> RedisResult < ( Self , impl Future < Output = ( ) > ) >
444
442
where
445
443
C : Unpin + AsyncRead + AsyncWrite + Send + ' static ,
@@ -457,10 +455,11 @@ impl MultiplexedConnection {
457
455
let codec = ValueCodec :: default ( )
458
456
. framed ( stream)
459
457
. 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 ) ;
461
460
let driver = boxed ( driver) ;
462
461
let pm = PushManager :: default ( ) ;
463
- if let Some ( sender) = push_sender {
462
+ if let Some ( sender) = glide_connection_options . push_sender {
464
463
pm. replace_sender ( sender) ;
465
464
}
466
465
0 commit comments