From a562df52554c485ef3545fb6dd4fc8da3643ad0a Mon Sep 17 00:00:00 2001 From: shacharPash Date: Wed, 15 Jun 2022 18:03:42 +0300 Subject: [PATCH 1/2] Add Support to 'SCRIPT KILL' Command --- src/StackExchange.Redis/Interfaces/IServer.cs | 11 +++++++++++ src/StackExchange.Redis/PublicAPI.Shipped.txt | 2 ++ src/StackExchange.Redis/RedisServer.cs | 12 ++++++++++++ 3 files changed, 25 insertions(+) diff --git a/src/StackExchange.Redis/Interfaces/IServer.cs b/src/StackExchange.Redis/Interfaces/IServer.cs index 7319f7feb..1c9180345 100644 --- a/src/StackExchange.Redis/Interfaces/IServer.cs +++ b/src/StackExchange.Redis/Interfaces/IServer.cs @@ -448,6 +448,17 @@ public partial interface IServer : IRedis /// Task ScriptLoadAsync(LuaScript script, CommandFlags flags = CommandFlags.None); + /// + /// Kills the currently executing EVAL script. + /// + /// The command flags to use. + /// Simple string reply. + /// + void ScriptKill(CommandFlags flags = CommandFlags.None); + + /// + Task ScriptKillAsync(CommandFlags flags = CommandFlags.None); + /// /// Asks the redis server to shutdown, killing all connections. Please FULLY read the notes on the SHUTDOWN command. /// diff --git a/src/StackExchange.Redis/PublicAPI.Shipped.txt b/src/StackExchange.Redis/PublicAPI.Shipped.txt index 8f20c4192..5dfa472e9 100644 --- a/src/StackExchange.Redis/PublicAPI.Shipped.txt +++ b/src/StackExchange.Redis/PublicAPI.Shipped.txt @@ -1056,6 +1056,8 @@ StackExchange.Redis.IServer.ScriptLoad(StackExchange.Redis.LuaScript! script, St StackExchange.Redis.IServer.ScriptLoad(string! script, StackExchange.Redis.CommandFlags flags = StackExchange.Redis.CommandFlags.None) -> byte[]! StackExchange.Redis.IServer.ScriptLoadAsync(StackExchange.Redis.LuaScript! script, StackExchange.Redis.CommandFlags flags = StackExchange.Redis.CommandFlags.None) -> System.Threading.Tasks.Task! StackExchange.Redis.IServer.ScriptLoadAsync(string! script, StackExchange.Redis.CommandFlags flags = StackExchange.Redis.CommandFlags.None) -> System.Threading.Tasks.Task! +StackExchange.Redis.IServer.ScriptKill(StackExchange.Redis.CommandFlags flags = StackExchange.Redis.CommandFlags.None) -> void +StackExchange.Redis.IServer.ScriptKillAsync(StackExchange.Redis.CommandFlags flags = StackExchange.Redis.CommandFlags.None) -> System.Threading.Tasks.Task! StackExchange.Redis.IServer.SentinelFailover(string! serviceName, StackExchange.Redis.CommandFlags flags = StackExchange.Redis.CommandFlags.None) -> void StackExchange.Redis.IServer.SentinelFailoverAsync(string! serviceName, StackExchange.Redis.CommandFlags flags = StackExchange.Redis.CommandFlags.None) -> System.Threading.Tasks.Task! StackExchange.Redis.IServer.SentinelGetMasterAddressByName(string! serviceName, StackExchange.Redis.CommandFlags flags = StackExchange.Redis.CommandFlags.None) -> System.Net.EndPoint? diff --git a/src/StackExchange.Redis/RedisServer.cs b/src/StackExchange.Redis/RedisServer.cs index dea6d586d..4f80f77f7 100644 --- a/src/StackExchange.Redis/RedisServer.cs +++ b/src/StackExchange.Redis/RedisServer.cs @@ -506,6 +506,18 @@ public Task ScriptLoadAsync(LuaScript script, CommandFlags flag return script.LoadAsync(this, flags); } + public void ScriptKill(CommandFlags flags = CommandFlags.None) + { + var msg = Message.Create(-1, flags, RedisCommand.SCRIPT, RedisLiterals.KILL); + ExecuteSync(msg, ResultProcessor.DemandOK); + } + + public Task ScriptKillAsync(CommandFlags flags = CommandFlags.None) + { + var msg = Message.Create(-1, flags, RedisCommand.SCRIPT, RedisLiterals.KILL); + return ExecuteAsync(msg, ResultProcessor.DemandOK); + } + public void Shutdown(ShutdownMode shutdownMode = ShutdownMode.Default, CommandFlags flags = CommandFlags.None) { Message msg = shutdownMode switch From b5a0cbb54576d1ad62b49896ea86a877c5c4b882 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Thu, 16 Jun 2022 15:47:24 +0300 Subject: [PATCH 2/2] Delete Return Line From documentation --- src/StackExchange.Redis/Interfaces/IServer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/StackExchange.Redis/Interfaces/IServer.cs b/src/StackExchange.Redis/Interfaces/IServer.cs index 1c9180345..4c2780358 100644 --- a/src/StackExchange.Redis/Interfaces/IServer.cs +++ b/src/StackExchange.Redis/Interfaces/IServer.cs @@ -452,7 +452,6 @@ public partial interface IServer : IRedis /// Kills the currently executing EVAL script. /// /// The command flags to use. - /// Simple string reply. /// void ScriptKill(CommandFlags flags = CommandFlags.None);