Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 910fde8

Browse files
committed
pre-empt final token renames (won't compile until CI completes)
1 parent 4a774b8 commit 910fde8

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/ServiceStack.Redis/RedisClientSet.Async.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ ValueTask<HashSet<string>> IRedisSetAsync.IntersectAsync(IRedisSetAsync[] withSe
6161
}
6262

6363
ValueTask<HashSet<string>> IRedisSetAsync.IntersectAsync(params IRedisSetAsync[] withSets)
64-
=> AsAsync().IntersectAsync(withSets, cancellationToken: default);
64+
=> AsAsync().IntersectAsync(withSets, token: default);
6565

6666
private List<string> MergeSetIds(IRedisSetAsync[] withSets)
6767
{
@@ -86,7 +86,7 @@ ValueTask IRedisSetAsync.StoreDiffAsync(IRedisSetAsync fromSet, IRedisSetAsync[]
8686
}
8787

8888
ValueTask IRedisSetAsync.StoreDiffAsync(IRedisSetAsync fromSet, params IRedisSetAsync[] withSets)
89-
=> AsAsync().StoreDiffAsync(fromSet, withSets, cancellationToken: default);
89+
=> AsAsync().StoreDiffAsync(fromSet, withSets, token: default);
9090

9191
ValueTask IRedisSetAsync.StoreIntersectAsync(IRedisSetAsync[] withSets, CancellationToken token)
9292
{
@@ -95,7 +95,7 @@ ValueTask IRedisSetAsync.StoreIntersectAsync(IRedisSetAsync[] withSets, Cancella
9595
}
9696

9797
ValueTask IRedisSetAsync.StoreIntersectAsync(params IRedisSetAsync[] withSets)
98-
=> AsAsync().StoreIntersectAsync(withSets, cancellationToken: default);
98+
=> AsAsync().StoreIntersectAsync(withSets, token: default);
9999

100100
ValueTask IRedisSetAsync.StoreUnionAsync(IRedisSetAsync[] withSets, CancellationToken token)
101101
{
@@ -104,7 +104,7 @@ ValueTask IRedisSetAsync.StoreUnionAsync(IRedisSetAsync[] withSets, Cancellation
104104
}
105105

106106
ValueTask IRedisSetAsync.StoreUnionAsync(params IRedisSetAsync[] withSets)
107-
=> AsAsync().StoreUnionAsync(withSets, cancellationToken: default);
107+
=> AsAsync().StoreUnionAsync(withSets, token: default);
108108

109109
ValueTask<HashSet<string>> IRedisSetAsync.UnionAsync(IRedisSetAsync[] withSets, CancellationToken token)
110110
{
@@ -113,6 +113,6 @@ ValueTask<HashSet<string>> IRedisSetAsync.UnionAsync(IRedisSetAsync[] withSets,
113113
}
114114

115115
ValueTask<HashSet<string>> IRedisSetAsync.UnionAsync(params IRedisSetAsync[] withSets)
116-
=> AsAsync().UnionAsync(withSets, cancellationToken: default);
116+
=> AsAsync().UnionAsync(withSets, token: default);
117117
}
118118
}

tests/ServiceStack.Redis.Tests/AsyncImplementationsTests.Async.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void TestSameAPI(Type syncInterface, Type asyncInterface)
8383
}
8484

8585
var expected = new List<string>();
86-
ParameterToken cancellationToken = new ParameterToken("token", typeof(CancellationToken), ParameterAttributes.Optional);
86+
ParameterToken cancellationParameter = new ParameterToken("token", typeof(CancellationToken), ParameterAttributes.Optional);
8787
foreach (var method in syncInterface.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
8888
{
8989
AddExpected(method);
@@ -367,11 +367,11 @@ static bool IsParams(in MethodToken tok)
367367

368368
if (IsParams(tok))
369369
{
370-
// include it with params but without cancellationToken
370+
// include it with params but without CancellationToken
371371
tok = new MethodToken(name, returnType, parameters, tok.IsGenericMethod, tok.IsGenericMethodDefinition, tok.GetGenericArguments(), tok.AllAttributes());
372372
expected.Add(GetSignature(tok));
373373

374-
// and now remove the params so we can get with cancellationToken
374+
// and now remove the params so we can get with CancellationToken
375375
ref ParameterToken p = ref parameters[parameters.Length - 1];
376376
p = p.WithAllAttributes(p.AllAttributes().Where(a => !(a is ParamArrayAttribute)).ToArray());
377377
}
@@ -483,11 +483,11 @@ static void Insert(ref ParameterToken[] parameters, int index, ParameterToken va
483483
}
484484
}
485485

486-
// append optional cancellationToken
486+
// append optional CancellationToken
487487
if (addCancellation)
488488
{
489489
Array.Resize(ref parameters, parameters.Length + 1);
490-
parameters[parameters.Length - 1] = cancellationToken;
490+
parameters[parameters.Length - 1] = cancellationParameter;
491491
}
492492
tok = new MethodToken(name, returnType, parameters, tok.IsGenericMethod, tok.IsGenericMethodDefinition, tok.GetGenericArguments(), tok.AllAttributes());
493493
expected.Add(GetSignature(tok));

tests/ServiceStack.Redis.Tests/RedisClientTestsBase.Async.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ public override void OnAfterEachTest()
113113
base.OnAfterEachTest();
114114
}
115115

116-
protected static async ValueTask<List<T>> ToListAsync<T>(IAsyncEnumerable<T> source, CancellationToken cancellationToken = default)
116+
protected static async ValueTask<List<T>> ToListAsync<T>(IAsyncEnumerable<T> source, CancellationToken token = default)
117117
{
118118
var list = new List<T>();
119-
await foreach (var value in source.ConfigureAwait(false).WithCancellation(cancellationToken))
119+
await foreach (var value in source.ConfigureAwait(false).WithCancellation(token))
120120
{
121121
list.Add(value);
122122
}

0 commit comments

Comments
 (0)