Skip to content

Commit 1dfb41a

Browse files
committed
make friendlier API to exec lua
1 parent 73b4d3f commit 1dfb41a

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

src/ServiceStack.Interfaces/Redis/IRedisClient.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//
2-
// http://code.google.com/p/servicestack/wiki/ServiceStackRedis
2+
// https://github.com/ServiceStack/ServiceStack.Redis/
33
// ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system
44
//
55
// Authors:
66
// Demis Bellot (demis.bellot@gmail.com)
77
//
8-
// Copyright 2010 Liquidbit Ltd.
8+
// Copyright 2013 ServiceStack.
99
//
1010
// Licensed under the same terms of Redis and ServiceStack: new BSD license.
1111
//
@@ -263,9 +263,12 @@ public interface IRedisClient
263263

264264
#region Eval/Lua operations
265265

266-
string GetEvalStr(string body, int numOfArgs, params string[] args);
267-
int GetEvalInt(string body, int numOfArgs, params string[] args);
268-
List<string> GetEvalMultiData(string body, int numOfArgs, params string[] args);
266+
string ExecLuaAsStr(string luaBody, int numOfArgs, params string[] args);
267+
string ExecLuaShaAsStr(string sha1, int numOfArgs, params string[] args);
268+
int ExecLuaAsInt(string luaBody, int numOfArgs, params string[] args);
269+
int ExecLuaShaAsInt(string sha1, int numOfArgs, params string[] args);
270+
List<string> ExecLuaAsList(string luaBody, int numOfArgs, params string[] args);
271+
List<string> ExecLuaShaAsList(string sha1, int numOfArgs, params string[] args);
269272

270273
#endregion
271274

src/ServiceStack.Interfaces/Redis/IRedisNativeClient.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//
2-
// http://code.google.com/p/servicestack/wiki/ServiceStackRedis
2+
// https://github.com/ServiceStack/ServiceStack.Redis/
33
// ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system
44
//
55
// Authors:
66
// Demis Bellot (demis.bellot@gmail.com)
77
//
8-
// Copyright 2010 Liquidbit Ltd.
8+
// Copyright 2013 ServiceStack.
99
//
1010
// Licensed under the same terms of Redis and ServiceStack: new BSD license.
1111
//
@@ -183,10 +183,15 @@ public interface IRedisNativeClient
183183
byte[][] PUnSubscribe(params string[] toChannelsMatchingPatterns);
184184
byte[][] ReceiveMessages();
185185

186-
int EvalInt(string body, int numberKeysInArgs, params byte[][] keys);
187-
string EvalStr(string body, int numberKeysInArgs, params byte[][] keys);
188-
byte[][] Eval(string body, int numberKeysInArgs, params byte[][] keys);
189-
byte[][] ScriptExists(params byte[][] sha1Refs);
186+
//Redis LUA support
187+
int EvalInt(string luaBody, int numberKeysInArgs, params byte[][] keys);
188+
int EvalShaInt(string sha1, int numberKeysInArgs, params byte[][] keys);
189+
string EvalStr(string luaBody, int numberKeysInArgs, params byte[][] keys);
190+
string EvalShaStr(string sha1, int numberKeysInArgs, params byte[][] keys);
191+
byte[][] Eval(string luaBody, int numberKeysInArgs, params byte[][] keys);
192+
byte[][] EvalSha(string sha1, int numberKeysInArgs, params byte[][] keys);
193+
194+
byte[][] ScriptExists(params byte[][] sha1Refs);
190195
void ScriptFlush();
191196
void ScriptKill();
192197
byte[] ScriptLoad(string body);

0 commit comments

Comments
 (0)