@@ -36,16 +36,16 @@ private ValueTask<ICacheClientAsync> GetReadOnlyCacheClientAsync(in Cancellation
36
36
private IRedisClientAsync ConfigureRedisClientAsync ( IRedisClientAsync client )
37
37
=> client ;
38
38
39
- ValueTask < ICacheClientAsync > IRedisClientsManagerAsync . GetCacheClientAsync ( CancellationToken cancellationToken )
40
- => GetCacheClientAsync ( cancellationToken ) ;
39
+ ValueTask < ICacheClientAsync > IRedisClientsManagerAsync . GetCacheClientAsync ( CancellationToken token )
40
+ => GetCacheClientAsync ( token ) ;
41
41
42
- ValueTask < IRedisClientAsync > IRedisClientsManagerAsync . GetClientAsync ( CancellationToken cancellationToken )
42
+ ValueTask < IRedisClientAsync > IRedisClientsManagerAsync . GetClientAsync ( CancellationToken token )
43
43
=> GetClientImpl ( ) . AsValueTaskResult < IRedisClientAsync > ( ) ;
44
44
45
- ValueTask < ICacheClientAsync > IRedisClientsManagerAsync . GetReadOnlyCacheClientAsync ( CancellationToken cancellationToken )
46
- => GetReadOnlyCacheClientAsync ( cancellationToken ) ;
45
+ ValueTask < ICacheClientAsync > IRedisClientsManagerAsync . GetReadOnlyCacheClientAsync ( CancellationToken token )
46
+ => GetReadOnlyCacheClientAsync ( token ) ;
47
47
48
- ValueTask < IRedisClientAsync > IRedisClientsManagerAsync . GetReadOnlyClientAsync ( CancellationToken cancellationToken )
48
+ ValueTask < IRedisClientAsync > IRedisClientsManagerAsync . GetReadOnlyClientAsync ( CancellationToken token )
49
49
=> GetReadOnlyClientImpl ( ) . AsValueTaskResult < IRedisClientAsync > ( ) ;
50
50
51
51
ValueTask IAsyncDisposable . DisposeAsync ( )
@@ -54,127 +54,127 @@ ValueTask IAsyncDisposable.DisposeAsync()
54
54
return default ;
55
55
}
56
56
57
- async Task < T > ICacheClientAsync . GetAsync < T > ( string key , CancellationToken cancellationToken )
57
+ async Task < T > ICacheClientAsync . GetAsync < T > ( string key , CancellationToken token )
58
58
{
59
- await using var client = await GetReadOnlyCacheClientAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
59
+ await using var client = await GetReadOnlyCacheClientAsync ( token ) . ConfigureAwait ( false ) ;
60
60
return await client . GetAsync < T > ( key ) . ConfigureAwait ( false ) ;
61
61
}
62
62
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 )
64
64
{
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 ) ;
67
67
}
68
68
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 )
70
70
{
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 ) ;
73
73
}
74
74
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 )
76
76
{
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 ) ;
79
79
}
80
80
81
- async Task ICacheClientAsync . FlushAllAsync ( CancellationToken cancellationToken )
81
+ async Task ICacheClientAsync . FlushAllAsync ( CancellationToken token )
82
82
{
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 ) ;
85
85
}
86
86
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 )
88
88
{
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 ) ;
91
91
}
92
92
93
- async Task ICacheClientAsync . SetAllAsync < T > ( IDictionary < string , T > values , CancellationToken cancellationToken )
93
+ async Task ICacheClientAsync . SetAllAsync < T > ( IDictionary < string , T > values , CancellationToken token )
94
94
{
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 ) ;
97
97
}
98
98
99
- async Task < bool > ICacheClientAsync . RemoveAsync ( string key , CancellationToken cancellationToken )
99
+ async Task < bool > ICacheClientAsync . RemoveAsync ( string key , CancellationToken token )
100
100
{
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 ) ;
103
103
}
104
104
105
- async Task ICacheClientAsync . RemoveAllAsync ( IEnumerable < string > keys , CancellationToken cancellationToken )
105
+ async Task ICacheClientAsync . RemoveAllAsync ( IEnumerable < string > keys , CancellationToken token )
106
106
{
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 ) ;
109
109
}
110
110
111
- async Task < long > ICacheClientAsync . IncrementAsync ( string key , uint amount , CancellationToken cancellationToken )
111
+ async Task < long > ICacheClientAsync . IncrementAsync ( string key , uint amount , CancellationToken token )
112
112
{
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 ) ;
115
115
}
116
116
117
- async Task < long > ICacheClientAsync . DecrementAsync ( string key , uint amount , CancellationToken cancellationToken )
117
+ async Task < long > ICacheClientAsync . DecrementAsync ( string key , uint amount , CancellationToken token )
118
118
{
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 ) ;
121
121
}
122
122
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 )
124
124
{
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 ) ;
127
127
}
128
128
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 )
130
130
{
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 ) ;
133
133
}
134
134
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 )
136
136
{
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 ) ;
139
139
}
140
140
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 )
142
142
{
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 ) ;
145
145
}
146
146
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 )
148
148
{
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 ) ;
151
151
}
152
152
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 )
154
154
{
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 ) ;
157
157
}
158
158
159
- async Task < TimeSpan ? > ICacheClientAsync . GetTimeToLiveAsync ( string key , CancellationToken cancellationToken )
159
+ async Task < TimeSpan ? > ICacheClientAsync . GetTimeToLiveAsync ( string key , CancellationToken token )
160
160
{
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 ) ;
163
163
}
164
164
165
- async IAsyncEnumerable < string > ICacheClientAsync . GetKeysByPatternAsync ( string pattern , [ EnumeratorCancellation ] CancellationToken cancellationToken )
165
+ async IAsyncEnumerable < string > ICacheClientAsync . GetKeysByPatternAsync ( string pattern , [ EnumeratorCancellation ] CancellationToken token )
166
166
{
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 ) )
169
169
{
170
170
yield return key ;
171
171
}
172
172
}
173
173
174
- async Task ICacheClientAsync . RemoveExpiredEntriesAsync ( CancellationToken cancellationToken )
174
+ async Task ICacheClientAsync . RemoveExpiredEntriesAsync ( CancellationToken token )
175
175
{
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 ) ;
178
178
}
179
179
}
180
180
}
0 commit comments