Skip to content

Commit fd5c2fd

Browse files
committed
naming is hard
1 parent c7c88c5 commit fd5c2fd

File tree

11 files changed

+122
-122
lines changed

11 files changed

+122
-122
lines changed

src/StackExchange.Redis/Enums/StreamDeleteMode.cs renamed to src/StackExchange.Redis/Enums/StreamTrimMode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <summary>
44
/// Determines how stream trimming works.
55
/// </summary>
6-
public enum StreamDeleteMode
6+
public enum StreamTrimMode
77
{
88
/// <summary>
99
/// Trims the stream according to the specified policy (MAXLEN or MINID) regardless of whether entries are referenced by any consumer groups, but preserves existing references to these entries in all consumer groups' PEL.

src/StackExchange.Redis/Enums/StreamDeleteResult.cs renamed to src/StackExchange.Redis/Enums/StreamTrimResult.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <summary>
44
/// Determines how stream trimming works.
55
/// </summary>
6-
public enum StreamDeleteResult
6+
public enum StreamTrimResult
77
{
88
/// <summary>
99
/// No such id exists in the provided stream key.
@@ -18,6 +18,6 @@ public enum StreamDeleteResult
1818
/// <summary>
1919
/// Entry was not deleted, but there are still dangling references.
2020
/// </summary>
21-
/// <remarks>This response relates to the <see cref="StreamDeleteMode.Acknowledged"/> mode.</remarks>
21+
/// <remarks>This response relates to the <see cref="StreamTrimMode.Acknowledged"/> mode.</remarks>
2222
NotDeleted = 2,
2323
}

src/StackExchange.Redis/Interfaces/IDatabase.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,7 +2451,7 @@ IEnumerable<SortedSetEntry> SortedSetScan(
24512451
/// <returns>The outcome of the delete operation.</returns>
24522452
/// <remarks><seealso href="https://redis.io/topics/streams-intro"/></remarks>
24532453
#pragma warning disable RS0026 // similar overloads
2454-
StreamDeleteResult StreamAcknowledgeAndDelete(RedisKey key, RedisValue groupName, StreamDeleteMode mode, RedisValue messageId, CommandFlags flags = CommandFlags.None);
2454+
StreamTrimResult StreamAcknowledgeAndDelete(RedisKey key, RedisValue groupName, StreamTrimMode mode, RedisValue messageId, CommandFlags flags = CommandFlags.None);
24552455
#pragma warning restore RS0026
24562456

24572457
/// <summary>
@@ -2465,7 +2465,7 @@ IEnumerable<SortedSetEntry> SortedSetScan(
24652465
/// <returns>The outcome of each delete operation.</returns>
24662466
/// <remarks><seealso href="https://redis.io/topics/streams-intro"/></remarks>
24672467
#pragma warning disable RS0026 // similar overloads
2468-
StreamDeleteResult[] StreamAcknowledgeAndDelete(RedisKey key, RedisValue groupName, StreamDeleteMode mode, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None);
2468+
StreamTrimResult[] StreamAcknowledgeAndDelete(RedisKey key, RedisValue groupName, StreamTrimMode mode, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None);
24692469
#pragma warning restore RS0026
24702470

24712471
/// <summary>
@@ -2511,12 +2511,12 @@ IEnumerable<SortedSetEntry> SortedSetScan(
25112511
/// <param name="maxLength">The maximum length of the stream.</param>
25122512
/// <param name="useApproximateMaxLength">If true, the "~" argument is used to allow the stream to exceed max length by a small number. This improves performance when removing messages.</param>
25132513
/// <param name="limit">Specifies the maximal count of entries that will be evicted.</param>
2514-
/// <param name="deleteMode">Determines how stream trimming should be performed.</param>
2514+
/// <param name="trimMode">Determines how stream trimming should be performed.</param>
25152515
/// <param name="flags">The flags to use for this operation.</param>
25162516
/// <returns>The ID of the newly created message.</returns>
25172517
/// <remarks><seealso href="https://redis.io/commands/xadd"/></remarks>
25182518
#pragma warning disable RS0026 // different shape
2519-
RedisValue StreamAdd(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode deleteMode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None);
2519+
RedisValue StreamAdd(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode trimMode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None);
25202520
#pragma warning restore RS0026
25212521

25222522
/// <summary>
@@ -2530,12 +2530,12 @@ IEnumerable<SortedSetEntry> SortedSetScan(
25302530
/// <param name="maxLength">The maximum length of the stream.</param>
25312531
/// <param name="useApproximateMaxLength">If true, the "~" argument is used to allow the stream to exceed max length by a small number. This improves performance when removing messages.</param>
25322532
/// <param name="limit">Specifies the maximal count of entries that will be evicted.</param>
2533-
/// <param name="deleteMode">Determines how stream trimming should be performed.</param>
2533+
/// <param name="trimMode">Determines how stream trimming should be performed.</param>
25342534
/// <param name="flags">The flags to use for this operation.</param>
25352535
/// <returns>The ID of the newly created message.</returns>
25362536
/// <remarks><seealso href="https://redis.io/commands/xadd"/></remarks>
25372537
#pragma warning disable RS0026 // different shape
2538-
RedisValue StreamAdd(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode deleteMode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None);
2538+
RedisValue StreamAdd(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode trimMode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None);
25392539
#pragma warning restore RS0026
25402540

25412541
/// <summary>
@@ -2853,7 +2853,7 @@ IEnumerable<SortedSetEntry> SortedSetScan(
28532853
/// <param name="flags">The flags to use for this operation.</param>
28542854
/// <returns>The number of messages removed from the stream.</returns>
28552855
/// <remarks><seealso href="https://redis.io/topics/streams-intro"/></remarks>
2856-
long StreamTrim(RedisKey key, long maxLength, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode mode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None);
2856+
long StreamTrim(RedisKey key, long maxLength, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode mode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None);
28572857

28582858
/// <summary>
28592859
/// Trim the stream to a specified minimum timestamp.
@@ -2866,7 +2866,7 @@ IEnumerable<SortedSetEntry> SortedSetScan(
28662866
/// <param name="flags">The flags to use for this operation.</param>
28672867
/// <returns>The number of messages removed from the stream.</returns>
28682868
/// <remarks><seealso href="https://redis.io/topics/streams-intro"/></remarks>
2869-
long StreamTrimByMinId(RedisKey key, RedisValue minId, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode mode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None);
2869+
long StreamTrimByMinId(RedisKey key, RedisValue minId, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode mode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None);
28702870

28712871
/// <summary>
28722872
/// If key already exists and is a string, this command appends the value at the end of the string.

src/StackExchange.Redis/Interfaces/IDatabaseAsync.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -595,11 +595,11 @@ IAsyncEnumerable<SortedSetEntry> SortedSetScanAsync(
595595
Task<long> StreamAcknowledgeAsync(RedisKey key, RedisValue groupName, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None);
596596

597597
#pragma warning disable RS0026 // similar overloads
598-
/// <inheritdoc cref="IDatabase.StreamAcknowledgeAndDelete(RedisKey, RedisValue, StreamDeleteMode, RedisValue, CommandFlags)"/>
599-
Task<StreamDeleteResult> StreamAcknowledgeAndDeleteAsync(RedisKey key, RedisValue groupName, StreamDeleteMode mode, RedisValue messageId, CommandFlags flags = CommandFlags.None);
598+
/// <inheritdoc cref="IDatabase.StreamAcknowledgeAndDelete(RedisKey, RedisValue, StreamTrimMode, RedisValue, CommandFlags)"/>
599+
Task<StreamTrimResult> StreamAcknowledgeAndDeleteAsync(RedisKey key, RedisValue groupName, StreamTrimMode mode, RedisValue messageId, CommandFlags flags = CommandFlags.None);
600600

601-
/// <inheritdoc cref="IDatabase.StreamAcknowledgeAndDelete(RedisKey, RedisValue, StreamDeleteMode, RedisValue[], CommandFlags)"/>
602-
Task<StreamDeleteResult[]> StreamAcknowledgeAndDeleteAsync(RedisKey key, RedisValue groupName, StreamDeleteMode mode, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None);
601+
/// <inheritdoc cref="IDatabase.StreamAcknowledgeAndDelete(RedisKey, RedisValue, StreamTrimMode, RedisValue[], CommandFlags)"/>
602+
Task<StreamTrimResult[]> StreamAcknowledgeAndDeleteAsync(RedisKey key, RedisValue groupName, StreamTrimMode mode, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None);
603603
#pragma warning restore RS0026
604604

605605
/// <inheritdoc cref="IDatabase.StreamAdd(RedisKey, RedisValue, RedisValue, RedisValue?, int?, bool, CommandFlags)"/>
@@ -609,11 +609,11 @@ IAsyncEnumerable<SortedSetEntry> SortedSetScanAsync(
609609
Task<RedisValue> StreamAddAsync(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId, int? maxLength, bool useApproximateMaxLength, CommandFlags flags);
610610

611611
#pragma warning disable RS0026 // similar overloads
612-
/// <inheritdoc cref="IDatabase.StreamAdd(RedisKey, RedisValue, RedisValue, RedisValue?, long?, bool, long?, StreamDeleteMode, CommandFlags)"/>
613-
Task<RedisValue> StreamAddAsync(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode deleteMode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None);
612+
/// <inheritdoc cref="IDatabase.StreamAdd(RedisKey, RedisValue, RedisValue, RedisValue?, long?, bool, long?, StreamTrimMode, CommandFlags)"/>
613+
Task<RedisValue> StreamAddAsync(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode trimMode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None);
614614

615-
/// <inheritdoc cref="IDatabase.StreamAdd(RedisKey, NameValueEntry[], RedisValue?, long?, bool, long?, StreamDeleteMode, CommandFlags)"/>
616-
Task<RedisValue> StreamAddAsync(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode deleteMode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None);
615+
/// <inheritdoc cref="IDatabase.StreamAdd(RedisKey, NameValueEntry[], RedisValue?, long?, bool, long?, StreamTrimMode, CommandFlags)"/>
616+
Task<RedisValue> StreamAddAsync(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode trimMode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None);
617617
#pragma warning restore RS0026
618618

619619
/// <inheritdoc cref="IDatabase.StreamAutoClaim(RedisKey, RedisValue, RedisValue, long, RedisValue, int?, CommandFlags)"/>
@@ -688,11 +688,11 @@ IAsyncEnumerable<SortedSetEntry> SortedSetScanAsync(
688688
/// <inheritdoc cref="IDatabase.StreamTrim(RedisKey, int, bool, CommandFlags)"/>
689689
Task<long> StreamTrimAsync(RedisKey key, int maxLength, bool useApproximateMaxLength, CommandFlags flags);
690690

691-
/// <inheritdoc cref="IDatabase.StreamTrim(RedisKey, long, bool, long?, StreamDeleteMode, CommandFlags)"/>
692-
Task<long> StreamTrimAsync(RedisKey key, long maxLength, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode mode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None);
691+
/// <inheritdoc cref="IDatabase.StreamTrim(RedisKey, long, bool, long?, StreamTrimMode, CommandFlags)"/>
692+
Task<long> StreamTrimAsync(RedisKey key, long maxLength, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode mode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None);
693693

694-
/// <inheritdoc cref="IDatabase.StreamTrimByMinId(RedisKey, RedisValue, bool, long?, StreamDeleteMode, CommandFlags)"/>
695-
Task<long> StreamTrimByMinIdAsync(RedisKey key, RedisValue minId, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode mode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None);
694+
/// <inheritdoc cref="IDatabase.StreamTrimByMinId(RedisKey, RedisValue, bool, long?, StreamTrimMode, CommandFlags)"/>
695+
Task<long> StreamTrimByMinIdAsync(RedisKey key, RedisValue minId, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode mode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None);
696696

697697
/// <inheritdoc cref="IDatabase.StringAppend(RedisKey, RedisValue, CommandFlags)"/>
698698
Task<long> StringAppendAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None);

src/StackExchange.Redis/KeyspaceIsolation/KeyPrefixed.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -564,10 +564,10 @@ public Task<long> StreamAcknowledgeAsync(RedisKey key, RedisValue groupName, Red
564564
public Task<long> StreamAcknowledgeAsync(RedisKey key, RedisValue groupName, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) =>
565565
Inner.StreamAcknowledgeAsync(ToInner(key), groupName, messageIds, flags);
566566

567-
public Task<StreamDeleteResult> StreamAcknowledgeAndDeleteAsync(RedisKey key, RedisValue groupName, StreamDeleteMode mode, RedisValue messageId, CommandFlags flags = CommandFlags.None) =>
567+
public Task<StreamTrimResult> StreamAcknowledgeAndDeleteAsync(RedisKey key, RedisValue groupName, StreamTrimMode mode, RedisValue messageId, CommandFlags flags = CommandFlags.None) =>
568568
Inner.StreamAcknowledgeAndDeleteAsync(ToInner(key), groupName, mode, messageId, flags);
569569

570-
public Task<StreamDeleteResult[]> StreamAcknowledgeAndDeleteAsync(RedisKey key, RedisValue groupName, StreamDeleteMode mode, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) =>
570+
public Task<StreamTrimResult[]> StreamAcknowledgeAndDeleteAsync(RedisKey key, RedisValue groupName, StreamTrimMode mode, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) =>
571571
Inner.StreamAcknowledgeAndDeleteAsync(ToInner(key), groupName, mode, messageIds, flags);
572572

573573
public Task<RedisValue> StreamAddAsync(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId, int? maxLength, bool useApproximateMaxLength, CommandFlags flags) =>
@@ -576,10 +576,10 @@ public Task<RedisValue> StreamAddAsync(RedisKey key, RedisValue streamField, Red
576576
public Task<RedisValue> StreamAddAsync(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId, int? maxLength, bool useApproximateMaxLength, CommandFlags flags) =>
577577
Inner.StreamAddAsync(ToInner(key), streamPairs, messageId, maxLength, useApproximateMaxLength, flags);
578578

579-
public Task<RedisValue> StreamAddAsync(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode mode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None) =>
579+
public Task<RedisValue> StreamAddAsync(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode mode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None) =>
580580
Inner.StreamAddAsync(ToInner(key), streamField, streamValue, messageId, maxLength, useApproximateMaxLength, limit, mode, flags);
581581

582-
public Task<RedisValue> StreamAddAsync(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode mode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None) =>
582+
public Task<RedisValue> StreamAddAsync(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, long? maxLength = null, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode mode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None) =>
583583
Inner.StreamAddAsync(ToInner(key), streamPairs, messageId, maxLength, useApproximateMaxLength, limit, mode, flags);
584584

585585
public Task<StreamAutoClaimResult> StreamAutoClaimAsync(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue startAtId, int? count = null, CommandFlags flags = CommandFlags.None) =>
@@ -654,10 +654,10 @@ public Task<RedisStream[]> StreamReadGroupAsync(StreamPosition[] streamPositions
654654
public Task<long> StreamTrimAsync(RedisKey key, int maxLength, bool useApproximateMaxLength, CommandFlags flags) =>
655655
Inner.StreamTrimAsync(ToInner(key), maxLength, useApproximateMaxLength, flags);
656656

657-
public Task<long> StreamTrimAsync(RedisKey key, long maxLength, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode mode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None) =>
657+
public Task<long> StreamTrimAsync(RedisKey key, long maxLength, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode mode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None) =>
658658
Inner.StreamTrimAsync(ToInner(key), maxLength, useApproximateMaxLength, limit, mode, flags);
659659

660-
public Task<long> StreamTrimByMinIdAsync(RedisKey key, RedisValue minId, bool useApproximateMaxLength = false, long? limit = null, StreamDeleteMode mode = StreamDeleteMode.KeepReferences, CommandFlags flags = CommandFlags.None) =>
660+
public Task<long> StreamTrimByMinIdAsync(RedisKey key, RedisValue minId, bool useApproximateMaxLength = false, long? limit = null, StreamTrimMode mode = StreamTrimMode.KeepReferences, CommandFlags flags = CommandFlags.None) =>
661661
Inner.StreamTrimByMinIdAsync(ToInner(key), minId, useApproximateMaxLength, limit, mode, flags);
662662

663663
public Task<long> StringAppendAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) =>

0 commit comments

Comments
 (0)