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

Commit 9d55712

Browse files
committed
adding sentinel command
1 parent 5dfa70a commit 9d55712

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/ServiceStack.Redis/Commands.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,8 @@ public static class Commands
180180
public readonly static byte[] Px = "PX".ToUtf8Bytes();
181181
public readonly static byte[] Nx = "NX".ToUtf8Bytes();
182182
public readonly static byte[] Xx = "XX".ToUtf8Bytes();
183+
184+
// Sentinel commands
185+
public readonly static byte[] Sentinel = "SENTINEL".ToUtf8Bytes();
183186
}
184187
}

src/ServiceStack.Redis/RedisNativeClient.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,24 @@ public byte[] BRPopLPush(string fromListId, string toListId, int timeOutSecs)
12091209
return result.Length == 0 ? null : result[1];
12101210
}
12111211

1212+
public object[] Sentinel(string command, string master = null)
1213+
{
1214+
if (command == null)
1215+
throw new ArgumentNullException("command");
1216+
1217+
var args = new List<byte[]>()
1218+
{
1219+
Commands.Sentinel,
1220+
command.ToUtf8Bytes()
1221+
};
1222+
1223+
if (master != null)
1224+
{
1225+
args.Add(master.ToUtf8Bytes());
1226+
}
1227+
return SendExpectDeeplyNestedMultiData(args.ToArray());
1228+
}
1229+
12121230
#endregion
12131231

12141232

0 commit comments

Comments
 (0)