55
66namespace StackExchange . Redis
77{
8- internal abstract partial class RedisBase : IRedis
8+ internal abstract class RedisBase : IRedis
99 {
1010 internal static readonly DateTime UnixEpoch = new DateTime ( 1970 , 1 , 1 , 0 , 0 , 0 , DateTimeKind . Utc ) ;
11- internal readonly ConnectionMultiplexer multiplexer ;
12- protected readonly object ? asyncState ;
11+ internal readonly ConnectionMultiplexer Multiplexer ;
12+ internal readonly object ? AsyncState ;
1313
1414 internal RedisBase ( ConnectionMultiplexer multiplexer , object ? asyncState )
1515 {
16- this . multiplexer = multiplexer ;
17- this . asyncState = asyncState ;
16+ Multiplexer = multiplexer ;
17+ AsyncState = asyncState ;
1818 }
1919
20- IConnectionMultiplexer IRedisAsync . Multiplexer => multiplexer ;
20+ IConnectionMultiplexer IRedisAsync . Multiplexer => Multiplexer ;
2121
22- internal CancellationToken GetEffectiveCancellationToken ( ) => multiplexer . GetEffectiveCancellationToken ( ) ;
22+ internal CancellationToken GetEffectiveCancellationToken ( ) => Multiplexer . GetEffectiveCancellationToken ( ) ;
2323
2424 public virtual TimeSpan Ping ( CommandFlags flags = CommandFlags . None )
2525 {
@@ -33,48 +33,48 @@ public virtual Task<TimeSpan> PingAsync(CommandFlags flags = CommandFlags.None)
3333 return ExecuteAsync ( msg , ResultProcessor . ResponseTimer ) ;
3434 }
3535
36- public override string ToString ( ) => multiplexer . ToString ( ) ;
36+ public override string ToString ( ) => Multiplexer . ToString ( ) ;
3737
38- public bool TryWait ( Task task ) => task . Wait ( multiplexer . TimeoutMilliseconds ) ;
38+ public bool TryWait ( Task task ) => task . Wait ( Multiplexer . TimeoutMilliseconds ) ;
3939
40- public void Wait ( Task task ) => multiplexer . Wait ( task ) ;
40+ public void Wait ( Task task ) => Multiplexer . Wait ( task ) ;
4141
42- public T Wait < T > ( Task < T > task ) => multiplexer . Wait ( task ) ;
42+ public T Wait < T > ( Task < T > task ) => Multiplexer . Wait ( task ) ;
4343
44- public void WaitAll ( params Task [ ] tasks ) => multiplexer . WaitAll ( tasks ) ;
44+ public void WaitAll ( params Task [ ] tasks ) => Multiplexer . WaitAll ( tasks ) ;
4545
4646 internal virtual Task < T > ExecuteAsync < T > ( Message ? message , ResultProcessor < T > ? processor , T defaultValue , ServerEndPoint ? server = null )
4747 {
48- if ( message is null ) return CompletedTask < T > . FromDefault ( defaultValue , asyncState ) ;
49- multiplexer . CheckMessage ( message ) ;
48+ if ( message is null ) return CompletedTask < T > . FromDefault ( defaultValue , AsyncState ) ;
49+ Multiplexer . CheckMessage ( message ) ;
5050
5151 // The message already captures the ambient cancellation token when it was created,
5252 // so we don't need to pass it again. This ensures resent messages preserve their original cancellation context.
53- return multiplexer . ExecuteAsyncImpl < T > ( message , processor , asyncState , server , defaultValue ) ;
53+ return Multiplexer . ExecuteAsyncImpl < T > ( message , processor , AsyncState , server , defaultValue ) ;
5454 }
5555
5656 internal virtual Task < T ? > ExecuteAsync < T > ( Message ? message , ResultProcessor < T > ? processor , ServerEndPoint ? server = null )
5757 {
58- if ( message is null ) return CompletedTask < T > . Default ( asyncState ) ;
59- multiplexer . CheckMessage ( message ) ;
58+ if ( message is null ) return CompletedTask < T > . Default ( AsyncState ) ;
59+ Multiplexer . CheckMessage ( message ) ;
6060
6161 // The message already captures the ambient cancellation token when it was created,
6262 // so we don't need to pass it again. This ensures resent messages preserve their original cancellation context.
63- return multiplexer . ExecuteAsyncImpl < T > ( message , processor , asyncState , server ) ;
63+ return Multiplexer . ExecuteAsyncImpl < T > ( message , processor , AsyncState , server ) ;
6464 }
6565
6666 [ return : NotNullIfNotNull ( "defaultValue" ) ]
6767 internal virtual T ? ExecuteSync < T > ( Message ? message , ResultProcessor < T > ? processor , ServerEndPoint ? server = null , T ? defaultValue = default )
6868 {
6969 if ( message is null ) return defaultValue ; // no-op
70- multiplexer . CheckMessage ( message ) ;
71- return multiplexer . ExecuteSyncImpl < T > ( message , processor , server , defaultValue ) ;
70+ Multiplexer . CheckMessage ( message ) ;
71+ return Multiplexer . ExecuteSyncImpl < T > ( message , processor , server , defaultValue ) ;
7272 }
7373
7474 internal virtual RedisFeatures GetFeatures ( in RedisKey key , CommandFlags flags , RedisCommand command , out ServerEndPoint ? server )
7575 {
76- server = multiplexer . SelectServer ( command , flags , key ) ;
77- var version = server == null ? multiplexer . RawConfig . DefaultVersion : server . Version ;
76+ server = Multiplexer . SelectServer ( command , flags , key ) ;
77+ var version = server == null ? Multiplexer . RawConfig . DefaultVersion : server . Version ;
7878 return new RedisFeatures ( version ) ;
7979 }
8080
@@ -118,7 +118,7 @@ protected static void WhenAlwaysOrNotExists(When when)
118118 private ResultProcessor . TimingProcessor . TimerMessage GetTimerMessage ( CommandFlags flags )
119119 {
120120 // do the best we can with available commands
121- var map = multiplexer . CommandMap ;
121+ var map = Multiplexer . CommandMap ;
122122 var cancellationToken = GetEffectiveCancellationToken ( ) ;
123123 if ( map . IsAvailable ( RedisCommand . PING ) )
124124 return ResultProcessor . TimingProcessor . CreateMessage ( - 1 , flags , RedisCommand . PING , default , cancellationToken ) ;
@@ -128,7 +128,7 @@ private ResultProcessor.TimingProcessor.TimerMessage GetTimerMessage(CommandFlag
128128 return ResultProcessor . TimingProcessor . CreateMessage ( - 1 , flags , RedisCommand . ECHO , RedisLiterals . PING , cancellationToken ) ;
129129 // as our fallback, we'll do something odd... we'll treat a key like a value, out of sheer desperation
130130 // note: this usually means: twemproxy/envoyproxy - in which case we're fine anyway, since the proxy does the routing
131- return ResultProcessor . TimingProcessor . CreateMessage ( 0 , flags , RedisCommand . EXISTS , ( RedisValue ) multiplexer . UniqueId , cancellationToken ) ;
131+ return ResultProcessor . TimingProcessor . CreateMessage ( 0 , flags , RedisCommand . EXISTS , ( RedisValue ) Multiplexer . UniqueId , cancellationToken ) ;
132132 }
133133
134134 internal static class CursorUtils
0 commit comments