@@ -36,16 +36,16 @@ private ValueTask<ICacheClientAsync> GetReadOnlyCacheClientAsync(in Cancellation
3636 private IRedisClientAsync ConfigureRedisClientAsync ( IRedisClientAsync client )
3737 => client ;
3838
39- ValueTask < ICacheClientAsync > IRedisClientsManagerAsync . GetCacheClientAsync ( CancellationToken cancellationToken )
40- => GetCacheClientAsync ( cancellationToken ) ;
39+ ValueTask < ICacheClientAsync > IRedisClientsManagerAsync . GetCacheClientAsync ( CancellationToken token )
40+ => GetCacheClientAsync ( token ) ;
4141
42- ValueTask < IRedisClientAsync > IRedisClientsManagerAsync . GetClientAsync ( CancellationToken cancellationToken )
42+ ValueTask < IRedisClientAsync > IRedisClientsManagerAsync . GetClientAsync ( CancellationToken token )
4343 => GetClientImpl ( ) . AsValueTaskResult < IRedisClientAsync > ( ) ;
4444
45- ValueTask < ICacheClientAsync > IRedisClientsManagerAsync . GetReadOnlyCacheClientAsync ( CancellationToken cancellationToken )
46- => GetReadOnlyCacheClientAsync ( cancellationToken ) ;
45+ ValueTask < ICacheClientAsync > IRedisClientsManagerAsync . GetReadOnlyCacheClientAsync ( CancellationToken token )
46+ => GetReadOnlyCacheClientAsync ( token ) ;
4747
48- ValueTask < IRedisClientAsync > IRedisClientsManagerAsync . GetReadOnlyClientAsync ( CancellationToken cancellationToken )
48+ ValueTask < IRedisClientAsync > IRedisClientsManagerAsync . GetReadOnlyClientAsync ( CancellationToken token )
4949 => GetReadOnlyClientImpl ( ) . AsValueTaskResult < IRedisClientAsync > ( ) ;
5050
5151 ValueTask IAsyncDisposable . DisposeAsync ( )
@@ -54,127 +54,127 @@ ValueTask IAsyncDisposable.DisposeAsync()
5454 return default ;
5555 }
5656
57- async Task < T > ICacheClientAsync . GetAsync < T > ( string key , CancellationToken cancellationToken )
57+ async Task < T > ICacheClientAsync . GetAsync < T > ( string key , CancellationToken token )
5858 {
59- await using var client = await GetReadOnlyCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
59+ await using var client = await GetReadOnlyCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
6060 return await client . GetAsync < T > ( key ) . ConfigureAwait ( false ) ;
6161 }
6262
63- async Task < bool > ICacheClientAsync . SetAsync < T > ( string key , T value , CancellationToken cancellationToken )
63+ async Task < bool > ICacheClientAsync . SetAsync < T > ( string key , T value , CancellationToken token )
6464 {
65- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
66- return await client . SetAsync < T > ( key , value , cancellationToken ) . ConfigureAwait ( false ) ;
65+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
66+ return await client . SetAsync < T > ( key , value , token ) . ConfigureAwait ( false ) ;
6767 }
6868
69- async Task < bool > ICacheClientAsync . SetAsync < T > ( string key , T value , DateTime expiresAt , CancellationToken cancellationToken )
69+ async Task < bool > ICacheClientAsync . SetAsync < T > ( string key , T value , DateTime expiresAt , CancellationToken token )
7070 {
71- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
72- return await client . SetAsync < T > ( key , value , expiresAt , cancellationToken ) . ConfigureAwait ( false ) ;
71+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
72+ return await client . SetAsync < T > ( key , value , expiresAt , token ) . ConfigureAwait ( false ) ;
7373 }
7474
75- async Task < bool > ICacheClientAsync . SetAsync < T > ( string key , T value , TimeSpan expiresIn , CancellationToken cancellationToken )
75+ async Task < bool > ICacheClientAsync . SetAsync < T > ( string key , T value , TimeSpan expiresIn , CancellationToken token )
7676 {
77- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
78- return await client . SetAsync < T > ( key , value , expiresIn , cancellationToken ) . ConfigureAwait ( false ) ;
77+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
78+ return await client . SetAsync < T > ( key , value , expiresIn , token ) . ConfigureAwait ( false ) ;
7979 }
8080
81- async Task ICacheClientAsync . FlushAllAsync ( CancellationToken cancellationToken )
81+ async Task ICacheClientAsync . FlushAllAsync ( CancellationToken token )
8282 {
83- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
84- await client . FlushAllAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
83+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
84+ await client . FlushAllAsync ( token ) . ConfigureAwait ( false ) ;
8585 }
8686
87- async Task < IDictionary < string , T > > ICacheClientAsync . GetAllAsync < T > ( IEnumerable < string > keys , CancellationToken cancellationToken )
87+ async Task < IDictionary < string , T > > ICacheClientAsync . GetAllAsync < T > ( IEnumerable < string > keys , CancellationToken token )
8888 {
89- await using var client = await GetReadOnlyCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
90- return await client . GetAllAsync < T > ( keys , cancellationToken ) . ConfigureAwait ( false ) ;
89+ await using var client = await GetReadOnlyCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
90+ return await client . GetAllAsync < T > ( keys , token ) . ConfigureAwait ( false ) ;
9191 }
9292
93- async Task ICacheClientAsync . SetAllAsync < T > ( IDictionary < string , T > values , CancellationToken cancellationToken )
93+ async Task ICacheClientAsync . SetAllAsync < T > ( IDictionary < string , T > values , CancellationToken token )
9494 {
95- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
96- await client . SetAllAsync < T > ( values , cancellationToken ) . ConfigureAwait ( false ) ;
95+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
96+ await client . SetAllAsync < T > ( values , token ) . ConfigureAwait ( false ) ;
9797 }
9898
99- async Task < bool > ICacheClientAsync . RemoveAsync ( string key , CancellationToken cancellationToken )
99+ async Task < bool > ICacheClientAsync . RemoveAsync ( string key , CancellationToken token )
100100 {
101- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
102- return await client . RemoveAsync ( key , cancellationToken ) . ConfigureAwait ( false ) ;
101+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
102+ return await client . RemoveAsync ( key , token ) . ConfigureAwait ( false ) ;
103103 }
104104
105- async Task ICacheClientAsync . RemoveAllAsync ( IEnumerable < string > keys , CancellationToken cancellationToken )
105+ async Task ICacheClientAsync . RemoveAllAsync ( IEnumerable < string > keys , CancellationToken token )
106106 {
107- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
108- await client . RemoveAllAsync ( keys , cancellationToken ) . ConfigureAwait ( false ) ;
107+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
108+ await client . RemoveAllAsync ( keys , token ) . ConfigureAwait ( false ) ;
109109 }
110110
111- async Task < long > ICacheClientAsync . IncrementAsync ( string key , uint amount , CancellationToken cancellationToken )
111+ async Task < long > ICacheClientAsync . IncrementAsync ( string key , uint amount , CancellationToken token )
112112 {
113- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
114- return await client . IncrementAsync ( key , amount , cancellationToken ) . ConfigureAwait ( false ) ;
113+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
114+ return await client . IncrementAsync ( key , amount , token ) . ConfigureAwait ( false ) ;
115115 }
116116
117- async Task < long > ICacheClientAsync . DecrementAsync ( string key , uint amount , CancellationToken cancellationToken )
117+ async Task < long > ICacheClientAsync . DecrementAsync ( string key , uint amount , CancellationToken token )
118118 {
119- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
120- return await client . DecrementAsync ( key , amount , cancellationToken ) . ConfigureAwait ( false ) ;
119+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
120+ return await client . DecrementAsync ( key , amount , token ) . ConfigureAwait ( false ) ;
121121 }
122122
123- async Task < bool > ICacheClientAsync . AddAsync < T > ( string key , T value , CancellationToken cancellationToken )
123+ async Task < bool > ICacheClientAsync . AddAsync < T > ( string key , T value , CancellationToken token )
124124 {
125- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
126- return await client . AddAsync < T > ( key , value , cancellationToken ) . ConfigureAwait ( false ) ;
125+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
126+ return await client . AddAsync < T > ( key , value , token ) . ConfigureAwait ( false ) ;
127127 }
128128
129- async Task < bool > ICacheClientAsync . ReplaceAsync < T > ( string key , T value , CancellationToken cancellationToken )
129+ async Task < bool > ICacheClientAsync . ReplaceAsync < T > ( string key , T value , CancellationToken token )
130130 {
131- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
132- return await client . ReplaceAsync < T > ( key , value , cancellationToken ) . ConfigureAwait ( false ) ;
131+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
132+ return await client . ReplaceAsync < T > ( key , value , token ) . ConfigureAwait ( false ) ;
133133 }
134134
135- async Task < bool > ICacheClientAsync . AddAsync < T > ( string key , T value , DateTime expiresAt , CancellationToken cancellationToken )
135+ async Task < bool > ICacheClientAsync . AddAsync < T > ( string key , T value , DateTime expiresAt , CancellationToken token )
136136 {
137- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
138- return await client . AddAsync < T > ( key , value , expiresAt , cancellationToken ) . ConfigureAwait ( false ) ;
137+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
138+ return await client . AddAsync < T > ( key , value , expiresAt , token ) . ConfigureAwait ( false ) ;
139139 }
140140
141- async Task < bool > ICacheClientAsync . ReplaceAsync < T > ( string key , T value , DateTime expiresAt , CancellationToken cancellationToken )
141+ async Task < bool > ICacheClientAsync . ReplaceAsync < T > ( string key , T value , DateTime expiresAt , CancellationToken token )
142142 {
143- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
144- return await client . ReplaceAsync < T > ( key , value , expiresAt , cancellationToken ) . ConfigureAwait ( false ) ;
143+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
144+ return await client . ReplaceAsync < T > ( key , value , expiresAt , token ) . ConfigureAwait ( false ) ;
145145 }
146146
147- async Task < bool > ICacheClientAsync . AddAsync < T > ( string key , T value , TimeSpan expiresIn , CancellationToken cancellationToken )
147+ async Task < bool > ICacheClientAsync . AddAsync < T > ( string key , T value , TimeSpan expiresIn , CancellationToken token )
148148 {
149- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
150- return await client . AddAsync < T > ( key , value , expiresIn , cancellationToken ) . ConfigureAwait ( false ) ;
149+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
150+ return await client . AddAsync < T > ( key , value , expiresIn , token ) . ConfigureAwait ( false ) ;
151151 }
152152
153- async Task < bool > ICacheClientAsync . ReplaceAsync < T > ( string key , T value , TimeSpan expiresIn , CancellationToken cancellationToken )
153+ async Task < bool > ICacheClientAsync . ReplaceAsync < T > ( string key , T value , TimeSpan expiresIn , CancellationToken token )
154154 {
155- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
156- return await client . ReplaceAsync < T > ( key , value , expiresIn , cancellationToken ) . ConfigureAwait ( false ) ;
155+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
156+ return await client . ReplaceAsync < T > ( key , value , expiresIn , token ) . ConfigureAwait ( false ) ;
157157 }
158158
159- async Task < TimeSpan ? > ICacheClientAsync . GetTimeToLiveAsync ( string key , CancellationToken cancellationToken )
159+ async Task < TimeSpan ? > ICacheClientAsync . GetTimeToLiveAsync ( string key , CancellationToken token )
160160 {
161- await using var client = await GetReadOnlyCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
162- return await client . GetTimeToLiveAsync ( key , cancellationToken ) . ConfigureAwait ( false ) ;
161+ await using var client = await GetReadOnlyCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
162+ return await client . GetTimeToLiveAsync ( key , token ) . ConfigureAwait ( false ) ;
163163 }
164164
165- async IAsyncEnumerable < string > ICacheClientAsync . GetKeysByPatternAsync ( string pattern , [ EnumeratorCancellation ] CancellationToken cancellationToken )
165+ async IAsyncEnumerable < string > ICacheClientAsync . GetKeysByPatternAsync ( string pattern , [ EnumeratorCancellation ] CancellationToken token )
166166 {
167- await using var client = await GetReadOnlyCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
168- await foreach ( var key in client . GetKeysByPatternAsync ( pattern , cancellationToken ) . ConfigureAwait ( false ) . WithCancellation ( cancellationToken ) )
167+ await using var client = await GetReadOnlyCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
168+ await foreach ( var key in client . GetKeysByPatternAsync ( pattern , token ) . ConfigureAwait ( false ) . WithCancellation ( token ) )
169169 {
170170 yield return key ;
171171 }
172172 }
173173
174- async Task ICacheClientAsync . RemoveExpiredEntriesAsync ( CancellationToken cancellationToken )
174+ async Task ICacheClientAsync . RemoveExpiredEntriesAsync ( CancellationToken token )
175175 {
176- await using var client = await GetCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
177- await client . RemoveExpiredEntriesAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
176+ await using var client = await GetCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
177+ await client . RemoveExpiredEntriesAsync ( token ) . ConfigureAwait ( false ) ;
178178 }
179179 }
180180}
0 commit comments