-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing [`ZMPOP`](https://redis.io/commands/zmpop/) and [`LMPOP`](https://redis.io/commands/lmpop/) as part of #2055 Co-authored-by: Nick Craver <[email protected]>
- Loading branch information
1 parent
e4a88dd
commit dbd52f1
Showing
14 changed files
with
599 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
|
||
namespace StackExchange.Redis; | ||
|
||
/// <summary> | ||
/// A contiguous portion of a redis list. | ||
/// </summary> | ||
public readonly struct ListPopResult | ||
{ | ||
/// <summary> | ||
/// A null ListPopResult, indicating no results. | ||
/// </summary> | ||
public static ListPopResult Null { get; } = new ListPopResult(RedisKey.Null, Array.Empty<RedisValue>()); | ||
|
||
/// <summary> | ||
/// Whether this object is null/empty. | ||
/// </summary> | ||
public bool IsNull => Key.IsNull && Values == Array.Empty<RedisValue>(); | ||
|
||
/// <summary> | ||
/// The key of the list that this set of entries came form. | ||
/// </summary> | ||
public RedisKey Key { get; } | ||
|
||
/// <summary> | ||
/// The values from the list. | ||
/// </summary> | ||
public RedisValue[] Values { get; } | ||
|
||
internal ListPopResult(RedisKey key, RedisValue[] values) | ||
{ | ||
Key = key; | ||
Values = values; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
|
||
namespace StackExchange.Redis; | ||
|
||
/// <summary> | ||
/// A contiguous portion of a redis sorted set. | ||
/// </summary> | ||
public readonly struct SortedSetPopResult | ||
{ | ||
/// <summary> | ||
/// A null SortedSetPopResult, indicating no results. | ||
/// </summary> | ||
public static SortedSetPopResult Null { get; } = new SortedSetPopResult(RedisKey.Null, Array.Empty<SortedSetEntry>()); | ||
|
||
/// <summary> | ||
/// Whether this object is null/empty. | ||
/// </summary> | ||
public bool IsNull => Key.IsNull && Entries == Array.Empty<SortedSetEntry>(); | ||
|
||
/// <summary> | ||
/// The key of the sorted set these entries came form. | ||
/// </summary> | ||
public RedisKey Key { get; } | ||
|
||
/// <summary> | ||
/// The provided entries of the sorted set. | ||
/// </summary> | ||
public SortedSetEntry[] Entries { get; } | ||
|
||
internal SortedSetPopResult(RedisKey key, SortedSetEntry[] entries) | ||
{ | ||
Key = key; | ||
Entries = entries; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.