diff --git a/src/SlimFaas/Database/DatabaseMockService.cs b/src/SlimFaas/Database/DatabaseMockService.cs index c093e1ed..35fd04e5 100644 --- a/src/SlimFaas/Database/DatabaseMockService.cs +++ b/src/SlimFaas/Database/DatabaseMockService.cs @@ -117,7 +117,7 @@ public Task ListCountElementAsync(string key, int maximum = Int32.MaxValue return Task.FromResult(list.Count); } - public async Task ListSetQueueItemStatus(string key, ListQueueItemStatus queueItemStatus) + public async Task ListCallbackAsync(string key, ListQueueItemStatus queueItemStatus) { await Task.Delay(100); } diff --git a/src/SlimFaas/Database/IDatabaseService.cs b/src/SlimFaas/Database/IDatabaseService.cs index 191430a4..887624d0 100644 --- a/src/SlimFaas/Database/IDatabaseService.cs +++ b/src/SlimFaas/Database/IDatabaseService.cs @@ -12,5 +12,5 @@ public interface IDatabaseService Task?> ListRightPopAsync(string key, int count = 1); Task ListCountAvailableElementAsync(string key, int maximum = int.MaxValue); Task ListCountElementAsync(string key, int maximum = int.MaxValue); - Task ListSetQueueItemStatus(string key, ListQueueItemStatus queueItemStatus); + Task ListCallbackAsync(string key, ListQueueItemStatus queueItemStatus); } diff --git a/src/SlimFaas/Database/ISlimFaasQueue.cs b/src/SlimFaas/Database/ISlimFaasQueue.cs index 4fed91e1..8a289d7b 100644 --- a/src/SlimFaas/Database/ISlimFaasQueue.cs +++ b/src/SlimFaas/Database/ISlimFaasQueue.cs @@ -6,7 +6,7 @@ public interface ISlimFaasQueue { Task EnqueueAsync(string key, byte[] message); Task?> DequeueAsync(string key, long count = 1); - Task ListSetQueueItemStatusAsync(string key, ListQueueItemStatus queueItemStatus); + Task ListCallbackAsync(string key, ListQueueItemStatus queueItemStatus); public Task CountAvailableElementAsync(string key, int maximum = int.MaxValue); public Task CountElementAsync(string key, int maximum = int.MaxValue); } diff --git a/src/SlimFaas/Database/SlimDataService.cs b/src/SlimFaas/Database/SlimDataService.cs index 8647bf06..f5588fba 100644 --- a/src/SlimFaas/Database/SlimDataService.cs +++ b/src/SlimFaas/Database/SlimDataService.cs @@ -201,12 +201,12 @@ private async Task DoListCountElementAsync(string key, int maximum) return 0L; } - public async Task ListSetQueueItemStatus(string key, ListQueueItemStatus queueItemStatus) + public async Task ListCallbackAsync(string key, ListQueueItemStatus queueItemStatus) { - await Retry.Do(() => DoListSetQueueItemStatus(key, queueItemStatus), _retryInterval, logger, MaxAttemptCount); + await Retry.Do(() => DoListCallbackAsync(key, queueItemStatus), _retryInterval, logger, MaxAttemptCount); } - private async Task DoListSetQueueItemStatus(string key, ListQueueItemStatus queueItemStatus) + private async Task DoListCallbackAsync(string key, ListQueueItemStatus queueItemStatus) { EndPoint endpoint = await GetAndWaitForLeader(); if (!cluster.LeadershipToken.IsCancellationRequested) diff --git a/src/SlimFaas/Database/SlimFaasQueue.cs b/src/SlimFaas/Database/SlimFaasQueue.cs index ba1fb9cf..69c797cc 100644 --- a/src/SlimFaas/Database/SlimFaasQueue.cs +++ b/src/SlimFaas/Database/SlimFaasQueue.cs @@ -17,7 +17,7 @@ public async Task EnqueueAsync(string key, byte[] data) => return data; } - public async Task ListSetQueueItemStatusAsync(string key, ListQueueItemStatus queueItemStatus) => await databaseService.ListSetQueueItemStatus($"{KeyPrefix}{key}", queueItemStatus); + public async Task ListCallbackAsync(string key, ListQueueItemStatus queueItemStatus) => await databaseService.ListCallbackAsync($"{KeyPrefix}{key}", queueItemStatus); public async Task CountAvailableElementAsync(string key, int maximum = int.MaxValue) => await databaseService.ListCountAvailableElementAsync($"{KeyPrefix}{key}", maximum); diff --git a/src/SlimFaas/SlimWorker.cs b/src/SlimFaas/SlimWorker.cs index a277c0f2..97376486 100644 --- a/src/SlimFaas/SlimWorker.cs +++ b/src/SlimFaas/SlimWorker.cs @@ -210,7 +210,7 @@ private async Task ManageProcessingTasksAsync(ISlimFaasQueue slimFaasQueue, if (listQueueItemStatus.Items.Count > 0) { - await slimFaasQueue.ListSetQueueItemStatusAsync(functionDeployment, listQueueItemStatus); + await slimFaasQueue.ListCallbackAsync(functionDeployment, listQueueItemStatus); } int numberProcessingTasks = processingTasks[functionDeployment].Count; diff --git a/tests/SlimData.Tests/RaftClusterTests.cs b/tests/SlimData.Tests/RaftClusterTests.cs index 8d7fe182..2c5337b0 100644 --- a/tests/SlimData.Tests/RaftClusterTests.cs +++ b/tests/SlimData.Tests/RaftClusterTests.cs @@ -269,7 +269,7 @@ await databaseServiceSlave.HashSetAsync("hashsetKey1", HttpCode = 200, }); } - await databaseServiceSlave.ListSetQueueItemStatus("listKey1", queueItemStatus); + await databaseServiceSlave.ListCallbackAsync("listKey1", queueItemStatus); await GetLocalClusterView(host1).ForceReplicationAsync(); var listLength2 = await databaseServiceSlave.ListCountAvailableElementAsync("listKey1"); diff --git a/tests/SlimFaas.Tests/SlimProxyMiddlewareTests.cs b/tests/SlimFaas.Tests/SlimProxyMiddlewareTests.cs index 1f0ac4d8..906070d7 100644 --- a/tests/SlimFaas.Tests/SlimProxyMiddlewareTests.cs +++ b/tests/SlimFaas.Tests/SlimProxyMiddlewareTests.cs @@ -79,7 +79,7 @@ internal class MemorySlimFaasQueue : ISlimFaasQueue public Task CountAvailableElementAsync(string key, int maximum) => throw new NotImplementedException(); public Task CountElementAsync(string key, int maximum) => throw new NotImplementedException(); - public Task ListSetQueueItemStatusAsync(string key, ListQueueItemStatus queueItemStatus) => throw new NotImplementedException(); + public Task ListCallbackAsync(string key, ListQueueItemStatus queueItemStatus) => throw new NotImplementedException(); public async Task EnqueueAsync(string key, byte[] message) => await Task.Delay(100);