From 811d84ae07bc547ebc4dd2459a4f607974571c44 Mon Sep 17 00:00:00 2001 From: gliljas Date: Wed, 16 Sep 2020 15:22:40 +0200 Subject: [PATCH] Upgrade Redis and use batching or transactions --- .../AzureFunctionExtensions.csproj | 2 +- .../Redis/RedisConfiguration.cs | 6 + .../Redis/RedisOutputAsyncCollector.cs | 93 +- .../Redis/RedisOutputAttribute.cs | 5 + .../RedisBatchMock.cs | 932 +++++++++++++++++ .../RedisDatabaseMock.cs | 543 +++++++++- .../RedisOutputAsyncCollectorTest.cs | 53 +- .../RedisTransactionMock.cs | 960 ++++++++++++++++++ 8 files changed, 2540 insertions(+), 54 deletions(-) create mode 100644 test/AzureFunctionExtensions.Test/RedisBatchMock.cs create mode 100644 test/AzureFunctionExtensions.Test/RedisTransactionMock.cs diff --git a/src/AzureFunctionExtensions/AzureFunctionExtensions.csproj b/src/AzureFunctionExtensions/AzureFunctionExtensions.csproj index 2551848..d8e2f7a 100644 --- a/src/AzureFunctionExtensions/AzureFunctionExtensions.csproj +++ b/src/AzureFunctionExtensions/AzureFunctionExtensions.csproj @@ -26,7 +26,7 @@ - + diff --git a/src/AzureFunctionExtensions/Redis/RedisConfiguration.cs b/src/AzureFunctionExtensions/Redis/RedisConfiguration.cs index 2022649..c0e7c04 100644 --- a/src/AzureFunctionExtensions/Redis/RedisConfiguration.cs +++ b/src/AzureFunctionExtensions/Redis/RedisConfiguration.cs @@ -37,6 +37,11 @@ public RedisConfiguration(IRedisDatabaseManager redisDatabaseManager) /// public bool SendInBatch { get; set; } = true; + /// + /// Send items in contiguous transaction to Redis + /// + public bool SendInTransaction { get; set; } = true; + /// /// Sets the operation to performed in Redis @@ -48,6 +53,7 @@ public RedisConfiguration(IRedisDatabaseManager redisDatabaseManager) /// Time to live in Redis /// public TimeSpan? TimeToLive { get; set; } + /// /// Initializes attributes, configuration and async collector diff --git a/src/AzureFunctionExtensions/Redis/RedisOutputAsyncCollector.cs b/src/AzureFunctionExtensions/Redis/RedisOutputAsyncCollector.cs index ce08736..6bdae52 100644 --- a/src/AzureFunctionExtensions/Redis/RedisOutputAsyncCollector.cs +++ b/src/AzureFunctionExtensions/Redis/RedisOutputAsyncCollector.cs @@ -46,7 +46,7 @@ public RedisOutputAsyncCollector(RedisConfiguration config, RedisOutputAttribute { BinaryValue = item.BinaryValue, ObjectValue = item.ObjectValue, - TextValue = item.TextValue, + TextValue = item.TextValue, Key = Utils.MergeValueForProperty(item.Key, attr.Key, config.Key), TimeToLive = Utils.MergeValueForNullableProperty(item.TimeToLive, attr.TimeToLive, config.TimeToLive), IncrementValue = item.IncrementValue, @@ -70,7 +70,7 @@ public RedisOutputAsyncCollector(RedisConfiguration config, RedisOutputAttribute else { await SendToRedis(finalItem); - } + } } /// @@ -80,13 +80,7 @@ public RedisOutputAsyncCollector(RedisConfiguration config, RedisOutputAttribute /// public async Task FlushAsync(CancellationToken cancellationToken = default(CancellationToken)) { - foreach (var item in this.redisOutputCollection) - { - await SendToRedis(item); - - if (cancellationToken != null && cancellationToken.IsCancellationRequested) - break; - } + await SendToRedis(this.redisOutputCollection.ToArray()); } /// @@ -94,39 +88,62 @@ public RedisOutputAsyncCollector(RedisConfiguration config, RedisOutputAttribute /// /// /// - async Task SendToRedis(RedisOutput item) + async Task SendToRedis(params RedisOutput[] items) { - var connectionString = Utils.MergeValueForProperty(attr.Connection, config.Connection); + var connectionString = Utils.MergeValueForProperty(attr.Connection, config.Connection); var db = redisDatabaseManager.GetDatabase(connectionString); // TODO: add support for multiple databases - - RedisValue value = CreateRedisValue(item); - - switch (item.Operation) + IDatabaseAsync dbAsync = db; + IBatch batch = null; + ITransaction transaction = null; + if (items.Length > 1) { - case RedisOutputOperation.SetKeyValue: - { - await db.StringSetAsync(item.Key, value, item.TimeToLive, When.Always, CommandFlags.FireAndForget); - break; - } - - case RedisOutputOperation.IncrementValue: - { - await db.StringIncrementAsync(item.Key, item.IncrementValue); - break; - } - - case RedisOutputOperation.ListRightPush: - { - await db.ListRightPushAsync(item.Key, value, When.Always, CommandFlags.FireAndForget); - break; - } - - case RedisOutputOperation.ListLeftPush: - { - await db.ListLeftPushAsync(item.Key, value, When.Always, CommandFlags.FireAndForget); - break; - } + if (this.config.SendInTransaction) + { + dbAsync = transaction = db.CreateTransaction(); + } + else + { + dbAsync = batch = db.CreateBatch(); + } + } + var tasks = new List(); + foreach (var item in items) + { + RedisValue value = CreateRedisValue(item); + + switch (item.Operation) + { + case RedisOutputOperation.SetKeyValue: + { + tasks.Add(dbAsync.StringSetAsync(item.Key, value, item.TimeToLive, When.Always, CommandFlags.FireAndForget)); + break; + } + + case RedisOutputOperation.IncrementValue: + { + tasks.Add(dbAsync.StringIncrementAsync(item.Key, item.IncrementValue)); + break; + } + + case RedisOutputOperation.ListRightPush: + { + tasks.Add(dbAsync.ListRightPushAsync(item.Key, value, When.Always, CommandFlags.FireAndForget)); + break; + } + + case RedisOutputOperation.ListLeftPush: + { + tasks.Add(dbAsync.ListLeftPushAsync(item.Key, value, When.Always, CommandFlags.FireAndForget)); + break; + } + } } + + transaction?.Execute(); + batch?.Execute(); + + await Task.WhenAll(tasks).ConfigureAwait(false); + } /// diff --git a/src/AzureFunctionExtensions/Redis/RedisOutputAttribute.cs b/src/AzureFunctionExtensions/Redis/RedisOutputAttribute.cs index bb8c7e6..d7f4806 100644 --- a/src/AzureFunctionExtensions/Redis/RedisOutputAttribute.cs +++ b/src/AzureFunctionExtensions/Redis/RedisOutputAttribute.cs @@ -28,6 +28,11 @@ public sealed class RedisOutputAttribute : Attribute, IConnectionProvider /// public bool SendInBatch { get; set; } = true; + /// + /// Send items in contiguous transaction to Redis + /// + public bool SendInTransaction { get; set; } = true; + /// /// Sets the operation to performed in Redis /// Default is diff --git a/test/AzureFunctionExtensions.Test/RedisBatchMock.cs b/test/AzureFunctionExtensions.Test/RedisBatchMock.cs new file mode 100644 index 0000000..d1e9e32 --- /dev/null +++ b/test/AzureFunctionExtensions.Test/RedisBatchMock.cs @@ -0,0 +1,932 @@ +using StackExchange.Redis; +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; + +namespace Fbeltrao.AzureFunctionExtensions.Test +{ + public class RedisBatchMock : IBatch + { + private readonly RedisDatabaseMock databaseMock; + Queue> actionQueue = new Queue>(); + + public RedisBatchMock(RedisDatabaseMock databaseMock) + { + this.databaseMock = databaseMock; + } + + public IConnectionMultiplexer Multiplexer => throw new NotImplementedException(); + + public Task DebugObjectAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public void Execute() + { + if (actionQueue.TryDequeue(out var action)) + { + Task.Run(()=>action()).ContinueWith(x=>Execute()); + } + } + + public Task ExecuteAsync(string command, params object[] args) + { + throw new NotImplementedException(); + } + + public Task ExecuteAsync(string command, ICollection args, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoAddAsync(RedisKey key, double longitude, double latitude, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoAddAsync(RedisKey key, GeoEntry value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoAddAsync(RedisKey key, GeoEntry[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoDistanceAsync(RedisKey key, RedisValue member1, RedisValue member2, GeoUnit unit = GeoUnit.Meters, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoHashAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoHashAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoPositionAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoPositionAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoRadiusAsync(RedisKey key, RedisValue member, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoRadiusAsync(RedisKey key, double longitude, double latitude, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoRemoveAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashDecrementAsync(RedisKey key, RedisValue hashField, long value = 1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashDecrementAsync(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashDeleteAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashDeleteAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashExistsAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashGetAllAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashGetAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashGetAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task> HashGetLeaseAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashIncrementAsync(RedisKey key, RedisValue hashField, long value = 1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashIncrementAsync(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashKeysAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public IAsyncEnumerable HashScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashSetAsync(RedisKey key, HashEntry[] hashFields, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashSetAsync(RedisKey key, RedisValue hashField, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashStringLengthAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashValuesAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogAddAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogAddAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogLengthAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogMergeAsync(RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogMergeAsync(RedisKey destination, RedisKey[] sourceKeys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task IdentifyEndpointAsync(RedisKey key = default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public bool IsConnected(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyDeleteAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyDeleteAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyDumpAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyExistsAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyExistsAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyExpireAsync(RedisKey key, TimeSpan? expiry, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyExpireAsync(RedisKey key, DateTime? expiry, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyIdleTimeAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyMigrateAsync(RedisKey key, EndPoint toServer, int toDatabase = 0, int timeoutMilliseconds = 0, MigrateOptions migrateOptions = MigrateOptions.None, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyMoveAsync(RedisKey key, int database, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyPersistAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyRandomAsync(CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyRenameAsync(RedisKey key, RedisKey newKey, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyRestoreAsync(RedisKey key, byte[] value, TimeSpan? expiry = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyTimeToLiveAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyTouchAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyTouchAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyTypeAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListGetByIndexAsync(RedisKey key, long index, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListInsertAfterAsync(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListInsertBeforeAsync(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListLeftPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListLeftPushAsync(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + var tcs = new TaskCompletionSource(); + actionQueue.Enqueue(new Func(() => databaseMock.ListLeftPushAsync(key, value, when, flags).ContinueWith(x => tcs.SetResult(x.Result)))); + return tcs.Task; + } + + public Task ListLeftPushAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListRangeAsync(RedisKey key, long start = 0, long stop = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListRemoveAsync(RedisKey key, RedisValue value, long count = 0, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListRightPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListRightPopLeftPushAsync(RedisKey source, RedisKey destination, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListRightPushAsync(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + var tcs = new TaskCompletionSource(); + actionQueue.Enqueue(new Func(() => databaseMock.ListRightPushAsync(key, value, when, flags).ContinueWith(x => tcs.SetResult(x.Result)))); + return tcs.Task; + } + + public Task ListRightPushAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListSetByIndexAsync(RedisKey key, long index, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListTrimAsync(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task LockExtendAsync(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task LockQueryAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task LockReleaseAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task LockTakeAsync(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task PingAsync(CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task PublishAsync(RedisChannel channel, RedisValue message, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ScriptEvaluateAsync(string script, RedisKey[] keys = null, RedisValue[] values = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ScriptEvaluateAsync(byte[] hash, RedisKey[] keys = null, RedisValue[] values = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ScriptEvaluateAsync(LuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ScriptEvaluateAsync(LoadedLuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetAddAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetAddAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetCombineAsync(SetOperation operation, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetCombineAsync(SetOperation operation, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetContainsAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetMembersAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetMoveAsync(RedisKey source, RedisKey destination, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetPopAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetRandomMemberAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetRandomMembersAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetRemoveAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetRemoveAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public IAsyncEnumerable SetScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortAndStoreAsync(RedisKey destination, RedisKey key, long skip = 0, long take = -1, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default, RedisValue[] get = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortAsync(RedisKey key, long skip = 0, long take = -1, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default, RedisValue[] get = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetAddAsync(RedisKey key, RedisValue member, double score, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task SortedSetAddAsync(RedisKey key, RedisValue member, double score, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey[] keys, double[] weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetDecrementAsync(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetIncrementAsync(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetLengthAsync(RedisKey key, double min = double.NegativeInfinity, double max = double.PositiveInfinity, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetLengthByValueAsync(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetPopAsync(RedisKey key, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetPopAsync(RedisKey key, long count, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByRankAsync(RedisKey key, long start = 0, long stop = -1, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByRankWithScoresAsync(RedisKey key, long start = 0, long stop = -1, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByScoreAsync(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByScoreWithScoresAsync(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByValueAsync(RedisKey key, RedisValue min, RedisValue max, Exclude exclude, long skip, long take = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByValueAsync(RedisKey key, RedisValue min = default, RedisValue max = default, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRankAsync(RedisKey key, RedisValue member, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRemoveAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRemoveAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRemoveRangeByRankAsync(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRemoveRangeByScoreAsync(RedisKey key, double start, double stop, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRemoveRangeByValueAsync(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public IAsyncEnumerable SortedSetScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetScoreAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAcknowledgeAsync(RedisKey key, RedisValue groupName, RedisValue messageId, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAcknowledgeAsync(RedisKey key, RedisValue groupName, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAddAsync(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAddAsync(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamClaimAsync(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamClaimIdsOnlyAsync(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamConsumerGroupSetPositionAsync(RedisKey key, RedisValue groupName, RedisValue position, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamConsumerInfoAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamCreateConsumerGroupAsync(RedisKey key, RedisValue groupName, RedisValue? position, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task StreamCreateConsumerGroupAsync(RedisKey key, RedisValue groupName, RedisValue? position = null, bool createStream = true, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamDeleteAsync(RedisKey key, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamDeleteConsumerAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamDeleteConsumerGroupAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamGroupInfoAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamInfoAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamPendingAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamPendingMessagesAsync(RedisKey key, RedisValue groupName, int count, RedisValue consumerName, RedisValue? minId = null, RedisValue? maxId = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamRangeAsync(RedisKey key, RedisValue? minId = null, RedisValue? maxId = null, int? count = null, Order messageOrder = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadAsync(RedisKey key, RedisValue position, int? count = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadAsync(StreamPosition[] streamPositions, int? countPerStream = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position, int? count, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position = null, int? count = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamTrimAsync(RedisKey key, int maxLength, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringAppendAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringBitCountAsync(RedisKey key, long start = 0, long end = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringBitOperationAsync(Bitwise operation, RedisKey destination, RedisKey first, RedisKey second = default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringBitOperationAsync(Bitwise operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringBitPositionAsync(RedisKey key, bool bit, long start = 0, long end = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringDecrementAsync(RedisKey key, long value = 1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringDecrementAsync(RedisKey key, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetBitAsync(RedisKey key, long offset, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task> StringGetLeaseAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetRangeAsync(RedisKey key, long start, long end, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetSetAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetWithExpiryAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringIncrementAsync(RedisKey key, long value = 1, CommandFlags flags = CommandFlags.None) + { + var tcs = new TaskCompletionSource(); + actionQueue.Enqueue(new Func(() => databaseMock.StringIncrementAsync(key, value, flags).ContinueWith(x => tcs.SetResult(x.Result)))); + return tcs.Task; + } + + public Task StringIncrementAsync(RedisKey key, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringSetAsync(RedisKey key, RedisValue value, TimeSpan? expiry = null, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + var tcs = new TaskCompletionSource(); + actionQueue.Enqueue(new Func(() => databaseMock.StringSetAsync(key, value, expiry, when, flags).ContinueWith(x => tcs.SetResult(x.Result)))); + return tcs.Task; + } + + public Task StringSetAsync(KeyValuePair[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringSetBitAsync(RedisKey key, long offset, bool bit, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringSetRangeAsync(RedisKey key, long offset, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public bool TryWait(Task task) + { + throw new NotImplementedException(); + } + + public void Wait(Task task) + { + throw new NotImplementedException(); + } + + public T Wait(Task task) + { + throw new NotImplementedException(); + } + + public void WaitAll(params Task[] tasks) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/test/AzureFunctionExtensions.Test/RedisDatabaseMock.cs b/test/AzureFunctionExtensions.Test/RedisDatabaseMock.cs index 940fb67..4796082 100644 --- a/test/AzureFunctionExtensions.Test/RedisDatabaseMock.cs +++ b/test/AzureFunctionExtensions.Test/RedisDatabaseMock.cs @@ -18,14 +18,16 @@ public class RedisDatabaseMock : IDatabase public ConnectionMultiplexer Multiplexer => throw new NotImplementedException(); - public IBatch CreateBatch(object asyncState = null) + IConnectionMultiplexer IRedisAsync.Multiplexer => throw new NotImplementedException(); + + public virtual IBatch CreateBatch(object asyncState = null) { - throw new NotImplementedException(); + return new RedisBatchMock(this); } public ITransaction CreateTransaction(object asyncState = null) { - throw new NotImplementedException(); + return new RedisTransactionMock(this); } public RedisValue DebugObject(RedisKey key, CommandFlags flags = CommandFlags.None) @@ -38,6 +40,136 @@ public Task DebugObjectAsync(RedisKey key, CommandFlags flags = Comm throw new NotImplementedException(); } + public RedisResult Execute(string command, params object[] args) + { + throw new NotImplementedException(); + } + + public RedisResult Execute(string command, ICollection args, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ExecuteAsync(string command, params object[] args) + { + throw new NotImplementedException(); + } + + public Task ExecuteAsync(string command, ICollection args, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public bool GeoAdd(RedisKey key, double longitude, double latitude, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public bool GeoAdd(RedisKey key, GeoEntry value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public long GeoAdd(RedisKey key, GeoEntry[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoAddAsync(RedisKey key, double longitude, double latitude, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoAddAsync(RedisKey key, GeoEntry value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoAddAsync(RedisKey key, GeoEntry[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public double? GeoDistance(RedisKey key, RedisValue member1, RedisValue member2, GeoUnit unit = GeoUnit.Meters, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoDistanceAsync(RedisKey key, RedisValue member1, RedisValue member2, GeoUnit unit = GeoUnit.Meters, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public string[] GeoHash(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public string GeoHash(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoHashAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoHashAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public GeoPosition?[] GeoPosition(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public GeoPosition? GeoPosition(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoPositionAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoPositionAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public GeoRadiusResult[] GeoRadius(RedisKey key, RedisValue member, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public GeoRadiusResult[] GeoRadius(RedisKey key, double longitude, double latitude, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoRadiusAsync(RedisKey key, RedisValue member, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoRadiusAsync(RedisKey key, double longitude, double latitude, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public bool GeoRemove(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoRemoveAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public long HashDecrement(RedisKey key, RedisValue hashField, long value = 1, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -118,6 +250,16 @@ public Task HashGetAsync(RedisKey key, RedisValue[] hashFields, Co throw new NotImplementedException(); } + public Lease HashGetLease(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task> HashGetLeaseAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public long HashIncrement(RedisKey key, RedisValue hashField, long value = 1, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -168,6 +310,11 @@ public IEnumerable HashScan(RedisKey key, RedisValue pattern, int pag throw new NotImplementedException(); } + public IAsyncEnumerable HashScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public void HashSet(RedisKey key, HashEntry[] hashFields, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -188,6 +335,16 @@ public Task HashSetAsync(RedisKey key, RedisValue hashField, RedisValue va throw new NotImplementedException(); } + public long HashStringLength(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashStringLengthAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public RedisValue[] HashValues(RedisKey key, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -308,11 +465,21 @@ public bool KeyExists(RedisKey key, CommandFlags flags = CommandFlags.None) throw new NotImplementedException(); } + public long KeyExists(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public Task KeyExistsAsync(RedisKey key, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); } + public Task KeyExistsAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public bool KeyExpire(RedisKey key, TimeSpan? expiry, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -333,6 +500,16 @@ public Task KeyExpireAsync(RedisKey key, DateTime? expiry, CommandFlags fl throw new NotImplementedException(); } + public TimeSpan? KeyIdleTime(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyIdleTimeAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public void KeyMigrate(RedisKey key, EndPoint toServer, int toDatabase = 0, int timeoutMilliseconds = 0, MigrateOptions migrateOptions = MigrateOptions.None, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -403,6 +580,26 @@ public Task KeyRestoreAsync(RedisKey key, byte[] value, TimeSpan? expiry = null, throw new NotImplementedException(); } + public bool KeyTouch(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public long KeyTouch(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyTouchAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyTouchAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public RedisType KeyType(RedisKey key, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -859,11 +1056,21 @@ public RedisValue SetPop(RedisKey key, CommandFlags flags = CommandFlags.None) throw new NotImplementedException(); } + public RedisValue[] SetPop(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public Task SetPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); } + public Task SetPopAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public RedisValue SetRandomMember(RedisKey key, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -914,6 +1121,11 @@ public IEnumerable SetScan(RedisKey key, RedisValue pattern, int pag throw new NotImplementedException(); } + public IAsyncEnumerable SetScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public RedisValue[] Sort(RedisKey key, long skip = 0, long take = -1, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default(RedisValue), RedisValue[] get = null, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -944,6 +1156,16 @@ public long SortedSetAdd(RedisKey key, SortedSetEntry[] values, CommandFlags fla throw new NotImplementedException(); } + public bool SortedSetAdd(RedisKey key, RedisValue member, double score, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public long SortedSetAdd(RedisKey key, SortedSetEntry[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public Task SortedSetAddAsync(RedisKey key, RedisValue member, double score, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -954,6 +1176,16 @@ public Task SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, Comma throw new NotImplementedException(); } + public Task SortedSetAddAsync(RedisKey key, RedisValue member, double score, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public long SortedSetCombineAndStore(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -1014,6 +1246,26 @@ public Task SortedSetLengthByValueAsync(RedisKey key, RedisValue min, Redi throw new NotImplementedException(); } + public SortedSetEntry? SortedSetPop(RedisKey key, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public SortedSetEntry[] SortedSetPop(RedisKey key, long count, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetPopAsync(RedisKey key, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetPopAsync(RedisKey key, long count, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public RedisValue[] SortedSetRangeByRank(RedisKey key, long start = 0, long stop = -1, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -1059,11 +1311,21 @@ public Task SortedSetRangeByScoreWithScoresAsync(RedisKey key, throw new NotImplementedException(); } + public RedisValue[] SortedSetRangeByValue(RedisKey key, RedisValue min = default, RedisValue max = default, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public Task SortedSetRangeByValueAsync(RedisKey key, RedisValue min = default(RedisValue), RedisValue max = default(RedisValue), Exclude exclude = Exclude.None, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); } + public Task SortedSetRangeByValueAsync(RedisKey key, RedisValue min = default, RedisValue max = default, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public long? SortedSetRank(RedisKey key, RedisValue member, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -1134,6 +1396,11 @@ public IEnumerable SortedSetScan(RedisKey key, RedisValue patter throw new NotImplementedException(); } + public IAsyncEnumerable SortedSetScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public double? SortedSetScore(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -1144,6 +1411,266 @@ public IEnumerable SortedSetScan(RedisKey key, RedisValue patter throw new NotImplementedException(); } + public long StreamAcknowledge(RedisKey key, RedisValue groupName, RedisValue messageId, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public long StreamAcknowledge(RedisKey key, RedisValue groupName, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAcknowledgeAsync(RedisKey key, RedisValue groupName, RedisValue messageId, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAcknowledgeAsync(RedisKey key, RedisValue groupName, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public RedisValue StreamAdd(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public RedisValue StreamAdd(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAddAsync(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAddAsync(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public StreamEntry[] StreamClaim(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamClaimAsync(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public RedisValue[] StreamClaimIdsOnly(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamClaimIdsOnlyAsync(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public bool StreamConsumerGroupSetPosition(RedisKey key, RedisValue groupName, RedisValue position, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamConsumerGroupSetPositionAsync(RedisKey key, RedisValue groupName, RedisValue position, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public StreamConsumerInfo[] StreamConsumerInfo(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamConsumerInfoAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public bool StreamCreateConsumerGroup(RedisKey key, RedisValue groupName, RedisValue? position, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public bool StreamCreateConsumerGroup(RedisKey key, RedisValue groupName, RedisValue? position = null, bool createStream = true, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamCreateConsumerGroupAsync(RedisKey key, RedisValue groupName, RedisValue? position, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task StreamCreateConsumerGroupAsync(RedisKey key, RedisValue groupName, RedisValue? position = null, bool createStream = true, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public long StreamDelete(RedisKey key, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamDeleteAsync(RedisKey key, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public long StreamDeleteConsumer(RedisKey key, RedisValue groupName, RedisValue consumerName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamDeleteConsumerAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public bool StreamDeleteConsumerGroup(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamDeleteConsumerGroupAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public StreamGroupInfo[] StreamGroupInfo(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamGroupInfoAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public StreamInfo StreamInfo(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamInfoAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public long StreamLength(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public StreamPendingInfo StreamPending(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamPendingAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public StreamPendingMessageInfo[] StreamPendingMessages(RedisKey key, RedisValue groupName, int count, RedisValue consumerName, RedisValue? minId = null, RedisValue? maxId = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamPendingMessagesAsync(RedisKey key, RedisValue groupName, int count, RedisValue consumerName, RedisValue? minId = null, RedisValue? maxId = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public StreamEntry[] StreamRange(RedisKey key, RedisValue? minId = null, RedisValue? maxId = null, int? count = null, Order messageOrder = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamRangeAsync(RedisKey key, RedisValue? minId = null, RedisValue? maxId = null, int? count = null, Order messageOrder = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public StreamEntry[] StreamRead(RedisKey key, RedisValue position, int? count = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public RedisStream[] StreamRead(StreamPosition[] streamPositions, int? countPerStream = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadAsync(RedisKey key, RedisValue position, int? count = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadAsync(StreamPosition[] streamPositions, int? countPerStream = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public StreamEntry[] StreamReadGroup(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position, int? count, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public StreamEntry[] StreamReadGroup(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position = null, int? count = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public RedisStream[] StreamReadGroup(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public RedisStream[] StreamReadGroup(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position, int? count, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position = null, int? count = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public long StreamTrim(RedisKey key, int maxLength, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamTrimAsync(RedisKey key, int maxLength, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public long StringAppend(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); @@ -1268,6 +1795,16 @@ public Task StringGetBitAsync(RedisKey key, long offset, CommandFlags flag throw new NotImplementedException(); } + public Lease StringGetLease(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task> StringGetLeaseAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + public RedisValue StringGetRange(RedisKey key, long start, long end, CommandFlags flags = CommandFlags.None) { throw new NotImplementedException(); diff --git a/test/AzureFunctionExtensions.Test/RedisOutputAsyncCollectorTest.cs b/test/AzureFunctionExtensions.Test/RedisOutputAsyncCollectorTest.cs index 8599fbc..976558c 100644 --- a/test/AzureFunctionExtensions.Test/RedisOutputAsyncCollectorTest.cs +++ b/test/AzureFunctionExtensions.Test/RedisOutputAsyncCollectorTest.cs @@ -12,13 +12,18 @@ namespace Fbeltrao.AzureFunctionExtensions.Test /// public class RedisOutputAsyncCollectorTest { - [Fact] - public async Task SetKeyValue_ConnectionInConfig_KeyInAttribute_OperationInAttribute_SetsValue() + [Theory] + [InlineData(false, false)] + [InlineData(true, false)] + [InlineData(true, true)] + public async Task SetKeyValue_ConnectionInConfig_KeyInAttribute_OperationInAttribute_SetsValue(bool sendInBatch, bool sendInTransaction) { var connectionManager = new Mock(); var config = new RedisConfiguration(connectionManager.Object) { - Connection = "localhost:3679", + Connection = "localhost:3679", + SendInBatch = sendInBatch, + SendInTransaction = sendInTransaction }; var attr = new RedisOutputAttribute() @@ -47,13 +52,18 @@ await target.AddAsync(new RedisOutput() Assert.Equal("test", (string)actual); } - [Fact] - public async Task IncrementValue_ConnectionInConfig_KeyInAttribute_OperationInAttribute_WithoutIncrementValue_IncrementsOne() + [Theory] + [InlineData(false, false)] + [InlineData(true, false)] + [InlineData(true, true)] + public async Task IncrementValue_ConnectionInConfig_KeyInAttribute_OperationInAttribute_WithoutIncrementValue_IncrementsOne(bool sendInBatch, bool sendInTransaction) { var connectionManager = new Mock(); var config = new RedisConfiguration(connectionManager.Object) { Connection = "localhost:3679", + SendInBatch = sendInBatch, + SendInTransaction = sendInTransaction }; var attr = new RedisOutputAttribute() @@ -81,13 +91,18 @@ await target.AddAsync(new RedisOutput() Assert.Equal(1, (long)actual); } - [Fact] - public async Task IncrementValue_ConnectionInConfig_KeyInAttribute_OperationInAttribute_By10_Increments10() + [Theory] + [InlineData(false,false)] + [InlineData(true, false)] + [InlineData(true, true)] + public async Task IncrementValue_ConnectionInConfig_KeyInAttribute_OperationInAttribute_By10_Increments10(bool sendInBatch, bool sendInTransaction) { var connectionManager = new Mock(); var config = new RedisConfiguration(connectionManager.Object) { Connection = "localhost:3679", + SendInBatch = sendInBatch, + SendInTransaction = sendInTransaction }; var attr = new RedisOutputAttribute() @@ -107,23 +122,32 @@ await target.AddAsync(new RedisOutput() { IncrementValue = 10 }); + await target.AddAsync(new RedisOutput() + { + IncrementValue = 10 + }); await target.FlushAsync(); connectionManager.VerifyAll(); var actual = redisDatabase.StringGet("myKey"); - Assert.Equal(10, (long)actual); + Assert.Equal(20, (long)actual); } - [Fact] - public async Task ListRightPush_ConnectionInConfig_KeyInAttribute_OperationInAttribute_AddsItemToEndOfList() + [Theory] + [InlineData(false, false)] + [InlineData(true, false)] + [InlineData(true, true)] + public async Task ListRightPush_ConnectionInConfig_KeyInAttribute_OperationInAttribute_AddsItemToEndOfList(bool sendInBatch, bool sendInTransaction) { var connectionManager = new Mock(); var config = new RedisConfiguration(connectionManager.Object) { Connection = "localhost:3679", + SendInBatch = sendInBatch, + SendInTransaction = sendInTransaction }; var attr = new RedisOutputAttribute() @@ -159,13 +183,18 @@ await target.AddAsync(new RedisOutput() Assert.Equal("last value", actual[1].ToString()); } - [Fact] - public async Task ListLeftPush_ConnectionInConfig_KeyInAttribute_OperationInAttribute_AddsItemToStartOfList() + [Theory] + [InlineData(false, false)] + [InlineData(true, false)] + [InlineData(true, true)] + public async Task ListLeftPush_ConnectionInConfig_KeyInAttribute_OperationInAttribute_AddsItemToStartOfList(bool sendInBatch, bool sendInTransaction) { var connectionManager = new Mock(); var config = new RedisConfiguration(connectionManager.Object) { Connection = "localhost:3679", + SendInBatch = sendInBatch, + SendInTransaction = sendInTransaction }; var attr = new RedisOutputAttribute() diff --git a/test/AzureFunctionExtensions.Test/RedisTransactionMock.cs b/test/AzureFunctionExtensions.Test/RedisTransactionMock.cs new file mode 100644 index 0000000..27c5f4d --- /dev/null +++ b/test/AzureFunctionExtensions.Test/RedisTransactionMock.cs @@ -0,0 +1,960 @@ +using StackExchange.Redis; +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; + +namespace Fbeltrao.AzureFunctionExtensions.Test +{ + internal class RedisTransactionMock : ITransaction + { + private RedisDatabaseMock databaseMock; + Queue> actionQueue = new Queue>(); + + public RedisTransactionMock(RedisDatabaseMock databaseMock) + { + this.databaseMock = databaseMock; + } + + public IConnectionMultiplexer Multiplexer => throw new NotImplementedException(); + + public ConditionResult AddCondition(Condition condition) + { + throw new NotImplementedException(); + } + + public Task DebugObjectAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public bool Execute(CommandFlags flags = CommandFlags.None) + { + Execute(); + return true; + } + + public void Execute() + { + if (actionQueue.TryDequeue(out var action)) + { + Task.Run(() => action()).ContinueWith(x => Execute()); + } + } + + public Task ExecuteAsync(CommandFlags flags = CommandFlags.None) + { + var tcs = new TaskCompletionSource(); + ExecuteNext(tcs); + return tcs.Task; + } + + private void ExecuteNext(TaskCompletionSource tcs) + { + if (actionQueue.TryDequeue(out var action)) + { + Task.Run(() => action()).ContinueWith(x => ExecuteNext(tcs)); + } + else + { + tcs.SetResult(true); + } + } + + public Task ExecuteAsync(string command, params object[] args) + { + throw new NotImplementedException(); + } + + public Task ExecuteAsync(string command, ICollection args, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoAddAsync(RedisKey key, double longitude, double latitude, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoAddAsync(RedisKey key, GeoEntry value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoAddAsync(RedisKey key, GeoEntry[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoDistanceAsync(RedisKey key, RedisValue member1, RedisValue member2, GeoUnit unit = GeoUnit.Meters, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoHashAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoHashAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoPositionAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoPositionAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoRadiusAsync(RedisKey key, RedisValue member, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoRadiusAsync(RedisKey key, double longitude, double latitude, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task GeoRemoveAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashDecrementAsync(RedisKey key, RedisValue hashField, long value = 1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashDecrementAsync(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashDeleteAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashDeleteAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashExistsAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashGetAllAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashGetAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashGetAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task> HashGetLeaseAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashIncrementAsync(RedisKey key, RedisValue hashField, long value = 1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashIncrementAsync(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashKeysAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public IAsyncEnumerable HashScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashSetAsync(RedisKey key, HashEntry[] hashFields, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashSetAsync(RedisKey key, RedisValue hashField, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashStringLengthAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HashValuesAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogAddAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogAddAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogLengthAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogMergeAsync(RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task HyperLogLogMergeAsync(RedisKey destination, RedisKey[] sourceKeys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task IdentifyEndpointAsync(RedisKey key = default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public bool IsConnected(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyDeleteAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyDeleteAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyDumpAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyExistsAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyExistsAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyExpireAsync(RedisKey key, TimeSpan? expiry, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyExpireAsync(RedisKey key, DateTime? expiry, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyIdleTimeAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyMigrateAsync(RedisKey key, EndPoint toServer, int toDatabase = 0, int timeoutMilliseconds = 0, MigrateOptions migrateOptions = MigrateOptions.None, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyMoveAsync(RedisKey key, int database, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyPersistAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyRandomAsync(CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyRenameAsync(RedisKey key, RedisKey newKey, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyRestoreAsync(RedisKey key, byte[] value, TimeSpan? expiry = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyTimeToLiveAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyTouchAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyTouchAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task KeyTypeAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListGetByIndexAsync(RedisKey key, long index, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListInsertAfterAsync(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListInsertBeforeAsync(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListLeftPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListLeftPushAsync(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + var tcs = new TaskCompletionSource(); + actionQueue.Enqueue(new Func(() => databaseMock.ListLeftPushAsync(key, value, when, flags).ContinueWith(x => tcs.SetResult(x.Result)))); + return tcs.Task; + } + + public Task ListLeftPushAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListRangeAsync(RedisKey key, long start = 0, long stop = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListRemoveAsync(RedisKey key, RedisValue value, long count = 0, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListRightPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListRightPopLeftPushAsync(RedisKey source, RedisKey destination, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListRightPushAsync(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + var tcs = new TaskCompletionSource(); + actionQueue.Enqueue(new Func(() => databaseMock.ListRightPushAsync(key, value, when, flags).ContinueWith(x => tcs.SetResult(x.Result)))); + return tcs.Task; + } + + public Task ListRightPushAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListSetByIndexAsync(RedisKey key, long index, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ListTrimAsync(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task LockExtendAsync(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task LockQueryAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task LockReleaseAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task LockTakeAsync(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task PingAsync(CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task PublishAsync(RedisChannel channel, RedisValue message, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ScriptEvaluateAsync(string script, RedisKey[] keys = null, RedisValue[] values = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ScriptEvaluateAsync(byte[] hash, RedisKey[] keys = null, RedisValue[] values = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ScriptEvaluateAsync(LuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task ScriptEvaluateAsync(LoadedLuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetAddAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetAddAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetCombineAsync(SetOperation operation, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetCombineAsync(SetOperation operation, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetContainsAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetMembersAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetMoveAsync(RedisKey source, RedisKey destination, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetPopAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetRandomMemberAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetRandomMembersAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetRemoveAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SetRemoveAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public IAsyncEnumerable SetScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortAndStoreAsync(RedisKey destination, RedisKey key, long skip = 0, long take = -1, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default, RedisValue[] get = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortAsync(RedisKey key, long skip = 0, long take = -1, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default, RedisValue[] get = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetAddAsync(RedisKey key, RedisValue member, double score, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task SortedSetAddAsync(RedisKey key, RedisValue member, double score, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey[] keys, double[] weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetDecrementAsync(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetIncrementAsync(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetLengthAsync(RedisKey key, double min = double.NegativeInfinity, double max = double.PositiveInfinity, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetLengthByValueAsync(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetPopAsync(RedisKey key, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetPopAsync(RedisKey key, long count, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByRankAsync(RedisKey key, long start = 0, long stop = -1, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByRankWithScoresAsync(RedisKey key, long start = 0, long stop = -1, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByScoreAsync(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByScoreWithScoresAsync(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByValueAsync(RedisKey key, RedisValue min, RedisValue max, Exclude exclude, long skip, long take = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRangeByValueAsync(RedisKey key, RedisValue min = default, RedisValue max = default, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRankAsync(RedisKey key, RedisValue member, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRemoveAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRemoveAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRemoveRangeByRankAsync(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRemoveRangeByScoreAsync(RedisKey key, double start, double stop, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetRemoveRangeByValueAsync(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public IAsyncEnumerable SortedSetScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task SortedSetScoreAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAcknowledgeAsync(RedisKey key, RedisValue groupName, RedisValue messageId, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAcknowledgeAsync(RedisKey key, RedisValue groupName, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAddAsync(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamAddAsync(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamClaimAsync(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamClaimIdsOnlyAsync(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamConsumerGroupSetPositionAsync(RedisKey key, RedisValue groupName, RedisValue position, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamConsumerInfoAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamCreateConsumerGroupAsync(RedisKey key, RedisValue groupName, RedisValue? position, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task StreamCreateConsumerGroupAsync(RedisKey key, RedisValue groupName, RedisValue? position = null, bool createStream = true, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamDeleteAsync(RedisKey key, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamDeleteConsumerAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamDeleteConsumerGroupAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamGroupInfoAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamInfoAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamPendingAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamPendingMessagesAsync(RedisKey key, RedisValue groupName, int count, RedisValue consumerName, RedisValue? minId = null, RedisValue? maxId = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamRangeAsync(RedisKey key, RedisValue? minId = null, RedisValue? maxId = null, int? count = null, Order messageOrder = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadAsync(RedisKey key, RedisValue position, int? count = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadAsync(StreamPosition[] streamPositions, int? countPerStream = null, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position, int? count, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position = null, int? count = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream, CommandFlags flags) + { + throw new NotImplementedException(); + } + + public Task StreamReadGroupAsync(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StreamTrimAsync(RedisKey key, int maxLength, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringAppendAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringBitCountAsync(RedisKey key, long start = 0, long end = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringBitOperationAsync(Bitwise operation, RedisKey destination, RedisKey first, RedisKey second = default, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringBitOperationAsync(Bitwise operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringBitPositionAsync(RedisKey key, bool bit, long start = 0, long end = -1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringDecrementAsync(RedisKey key, long value = 1, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringDecrementAsync(RedisKey key, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetBitAsync(RedisKey key, long offset, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task> StringGetLeaseAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetRangeAsync(RedisKey key, long start, long end, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetSetAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringGetWithExpiryAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringIncrementAsync(RedisKey key, long value = 1, CommandFlags flags = CommandFlags.None) + { + var tcs = new TaskCompletionSource(); + actionQueue.Enqueue(new Func(() => databaseMock.StringIncrementAsync(key, value, flags).ContinueWith(x => tcs.SetResult(x.Result)))); + return tcs.Task; + } + + public Task StringIncrementAsync(RedisKey key, double value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringSetAsync(RedisKey key, RedisValue value, TimeSpan? expiry = null, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringSetAsync(KeyValuePair[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringSetBitAsync(RedisKey key, long offset, bool bit, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public Task StringSetRangeAsync(RedisKey key, long offset, RedisValue value, CommandFlags flags = CommandFlags.None) + { + throw new NotImplementedException(); + } + + public bool TryWait(Task task) + { + throw new NotImplementedException(); + } + + public void Wait(Task task) + { + throw new NotImplementedException(); + } + + public T Wait(Task task) + { + throw new NotImplementedException(); + } + + public void WaitAll(params Task[] tasks) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file