Skip to content

Commit 0171221

Browse files
authoredOct 1, 2024
Deprecate Triggers and Functions (#343)
deprecate T&F
1 parent 0a8bdfa commit 0171221

File tree

4 files changed

+16
-211
lines changed

4 files changed

+16
-211
lines changed
 

‎src/NRedisStack/Gears/GearsCommandBuilder.cs

+5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
namespace NRedisStack
44
{
55

6+
[Obsolete]
67
public static class GearsCommandBuilder
78
{
9+
[Obsolete]
810
public static SerializedCommand TFunctionLoad(string libraryCode, bool replace = false, string? config = null)
911
{
1012
var args = new List<object>() { GearsArgs.LOAD };
@@ -23,11 +25,13 @@ public static SerializedCommand TFunctionLoad(string libraryCode, bool replace =
2325
return new SerializedCommand(RG.TFUNCTION, args);
2426
}
2527

28+
[Obsolete]
2629
public static SerializedCommand TFunctionDelete(string libraryName)
2730
{
2831
return new SerializedCommand(RG.TFUNCTION, GearsArgs.DELETE, libraryName);
2932
}
3033

34+
[Obsolete]
3135
public static SerializedCommand TFunctionList(bool withCode = false, int verbose = 0, string? libraryName = null)
3236
{
3337
var args = new List<object>() { GearsArgs.LIST };
@@ -55,6 +59,7 @@ public static SerializedCommand TFunctionList(bool withCode = false, int verbose
5559
return new SerializedCommand(RG.TFUNCTION, args);
5660
}
5761

62+
[Obsolete]
5863
public static SerializedCommand TFCall(string libraryName, string functionName, string[]? keys = null, string[]? args = null, bool async = false)
5964
{
6065
string command = async ? RG.TFCALLASYNC : RG.TFCALL;

‎src/NRedisStack/Gears/GearsCommands.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using StackExchange.Redis;
22
namespace NRedisStack
33
{
4-
4+
[Obsolete]
55
public static class GearsCommands //: GearsCommandsAsync, IGearsCommands
66
{
77

@@ -17,6 +17,7 @@ public static class GearsCommands //: GearsCommandsAsync, IGearsCommands
1717
/// <param name="replace">an optional argument, instructs RedisGears to replace the function if its already exists.</param>
1818
/// <returns><see langword="true"/> if everything was done correctly, Error otherwise.</returns>
1919
/// <remarks><seealso href="https://redis.io/commands/tfunction-load/"/></remarks> //TODO: check this link when it's available
20+
[Obsolete]
2021
public static bool TFunctionLoad(this IDatabase db, string libraryCode, bool replace = false, string? config = null)
2122
{
2223
return db.Execute(GearsCommandBuilder.TFunctionLoad(libraryCode, replace, config)).OKtoBoolean();
@@ -28,6 +29,7 @@ public static bool TFunctionLoad(this IDatabase db, string libraryCode, bool rep
2829
/// <param name="libraryName">the name of the library to delete.</param>
2930
/// <returns><see langword="true"/> if the library was deleted successfully, Error otherwise.</returns>
3031
/// <remarks><seealso href="https://redis.io/commands/tfunction-delete/"/></remarks> //TODO: check this link when it's available
32+
[Obsolete]
3133
public static bool TFunctionDelete(this IDatabase db, string libraryName)
3234
{
3335
return db.Execute(GearsCommandBuilder.TFunctionDelete(libraryName)).OKtoBoolean();
@@ -42,6 +44,7 @@ public static bool TFunctionDelete(this IDatabase db, string libraryName)
4244
/// multiple times to show multiple libraries in a single command)</param>
4345
/// <returns>Information about the requested libraries.</returns>
4446
/// <remarks><seealso href="https://redis.io/commands/tfunction-list/"/></remarks> //TODO: check this link when it's available
47+
[Obsolete]
4548
public static Dictionary<string, RedisResult>[] TFunctionList(this IDatabase db, bool withCode = false, int verbose = 0, string? libraryName = null)
4649
{
4750
return db.Execute(GearsCommandBuilder.TFunctionList(withCode, verbose, libraryName)).ToDictionarys();
@@ -56,6 +59,7 @@ public static Dictionary<string, RedisResult>[] TFunctionList(this IDatabase db,
5659
/// <param name="args">Additional argument to pass to the function.</param>
5760
/// <returns>The return value from the sync &amp; async function on error in case of failure.</returns>
5861
/// <remarks><seealso href="https://redis.io/commands/tfcall"/></remarks>
62+
[Obsolete]
5963
public static RedisResult TFCall_(this IDatabase db, string libraryName, string functionName, string[]? keys = null, string[]? args = null)
6064
{
6165
return db.Execute(GearsCommandBuilder.TFCall(libraryName, functionName, keys, args, async: false));
@@ -70,6 +74,7 @@ public static RedisResult TFCall_(this IDatabase db, string libraryName, string
7074
/// <param name="args">Additional argument to pass to the function.</param>
7175
/// <returns>The return value from the sync &amp; async function on error in case of failure.</returns>
7276
/// <remarks><seealso href="https://redis.io/commands/tfcallasync"/></remarks>
77+
[Obsolete]
7378
public static RedisResult TFCallAsync_(this IDatabase db, string libraryName, string functionName, string[]? keys = null, string[]? args = null)
7479
{
7580
return db.Execute(GearsCommandBuilder.TFCall(libraryName, functionName, keys, args, async: true));

‎src/NRedisStack/Gears/GearsCommandsAsync.cs

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public static class GearsCommandsAsync //: IGearsCommandsAsync
1616
/// <param name="replace">an optional argument, instructs RedisGears to replace the function if its already exists.</param>
1717
/// <returns><see langword="true"/> if everything was done correctly, Error otherwise.</returns>
1818
/// <remarks><seealso href="https://redis.io/commands/"/></remarks> //TODO: add link to the command when it's available
19+
[Obsolete]
1920
public static async Task<bool> TFunctionLoadAsync(this IDatabase db, string libraryCode, string? config = null, bool replace = false)
2021
{
2122
return (await db.ExecuteAsync(GearsCommandBuilder.TFunctionLoad(libraryCode, replace, config))).OKtoBoolean();
@@ -27,6 +28,7 @@ public static async Task<bool> TFunctionLoadAsync(this IDatabase db, string libr
2728
/// <param name="libraryName">the name of the library to delete.</param>
2829
/// <returns><see langword="true"/> if the library was deleted successfully, Error otherwise.</returns>
2930
/// <remarks><seealso href="https://redis.io/commands/"/></remarks> //TODO: add link to the command when it's available
31+
[Obsolete]
3032
public static async Task<bool> TFunctionDeleteAsync(this IDatabase db, string libraryName)
3133
{
3234
return (await db.ExecuteAsync(GearsCommandBuilder.TFunctionDelete(libraryName))).OKtoBoolean();
@@ -41,6 +43,7 @@ public static async Task<bool> TFunctionDeleteAsync(this IDatabase db, string li
4143
/// multiple times to show multiple libraries in a single command)</param>
4244
/// <returns>Information about the requested libraries.</returns>
4345
/// <remarks><seealso href="https://redis.io/commands/"/></remarks> //TODO: add link to the command when it's available
46+
[Obsolete]
4447
public static async Task<Dictionary<string, RedisResult>[]> TFunctionListAsync(this IDatabase db, bool withCode = false, int verbose = 0, string? libraryName = null)
4548
{
4649
return (await db.ExecuteAsync(GearsCommandBuilder.TFunctionList(withCode, verbose, libraryName))).ToDictionarys();
@@ -55,6 +58,7 @@ public static async Task<Dictionary<string, RedisResult>[]> TFunctionListAsync(t
5558
/// <param name="args">Additional argument to pass to the function.</param>
5659
/// <returns>The return value from the sync &amp; async function on error in case of failure.</returns>
5760
/// <remarks><seealso href="https://redis.io/commands/tfcall"/></remarks>
61+
[Obsolete]
5862
public async static Task<RedisResult> TFCall_Async(this IDatabase db, string libraryName, string functionName, string[]? keys = null, string[]? args = null)
5963
{
6064
return await db.ExecuteAsync(GearsCommandBuilder.TFCall(libraryName, functionName, keys, args, async: false));
@@ -69,6 +73,7 @@ public async static Task<RedisResult> TFCall_Async(this IDatabase db, string lib
6973
/// <param name="args">Additional argument to pass to the function.</param>
7074
/// <returns>The return value from the sync &amp; async function on error in case of failure.</returns>
7175
/// <remarks><seealso href="https://redis.io/commands/tfcallasync"/></remarks>
76+
[Obsolete]
7277
public async static Task<RedisResult> TFCallAsync_Async(this IDatabase db, string libraryName, string functionName, string[]? keys = null, string[]? args = null)
7378
{
7479
return await db.ExecuteAsync(GearsCommandBuilder.TFCall(libraryName, functionName, keys, args, async: true));

‎tests/NRedisStack.Tests/Gears/GearsTests.cs

-210
This file was deleted.

0 commit comments

Comments
 (0)