From 7d1f8f228bb8476d3cda4aaa6db21f3635637c08 Mon Sep 17 00:00:00 2001 From: Ogoun Date: Sun, 23 Jul 2023 18:26:23 +0300 Subject: [PATCH] IterateKeyBacket fix --- .../Interfaces/IStorePartitionAccessor.cs | 2 +- .../PartitionStorage/Partition/StorePartitionAccessor.cs | 4 ++-- ZeroLevel/ZeroLevel.csproj | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ZeroLevel/Services/PartitionStorage/Interfaces/IStorePartitionAccessor.cs b/ZeroLevel/Services/PartitionStorage/Interfaces/IStorePartitionAccessor.cs index 870aaff..6d0574a 100644 --- a/ZeroLevel/Services/PartitionStorage/Interfaces/IStorePartitionAccessor.cs +++ b/ZeroLevel/Services/PartitionStorage/Interfaces/IStorePartitionAccessor.cs @@ -33,7 +33,7 @@ namespace ZeroLevel.Services.PartitionStorage /// /// Iterating over all recorded data of the file with the specified key /// - Task IterateKeyBacket(TKey key, Action kvHandler); + IAsyncEnumerable> IterateKeyBacket(TKey key); /// /// Deleting the specified key and associated data /// diff --git a/ZeroLevel/Services/PartitionStorage/Partition/StorePartitionAccessor.cs b/ZeroLevel/Services/PartitionStorage/Partition/StorePartitionAccessor.cs index 94841b1..1a8b49b 100644 --- a/ZeroLevel/Services/PartitionStorage/Partition/StorePartitionAccessor.cs +++ b/ZeroLevel/Services/PartitionStorage/Partition/StorePartitionAccessor.cs @@ -134,7 +134,7 @@ namespace ZeroLevel.Services.PartitionStorage } } } - public async Task IterateKeyBacket(TKey key, Action kvHandler) + public async IAsyncEnumerable> IterateKeyBacket(TKey key) { var fileName = _options.GetFileName(key, _info); var filePath = Path.Combine(_catalog, fileName); @@ -153,7 +153,7 @@ namespace ZeroLevel.Services.PartitionStorage var vv = await Serializer.ValueDeserializer.Invoke(reader); if (vv.Success == false) break; - kvHandler.Invoke(kv.Value, vv.Value); + yield return new KV(kv.Value, vv.Value); } } } diff --git a/ZeroLevel/ZeroLevel.csproj b/ZeroLevel/ZeroLevel.csproj index 20631e2..b23f9bd 100644 --- a/ZeroLevel/ZeroLevel.csproj +++ b/ZeroLevel/ZeroLevel.csproj @@ -6,16 +6,16 @@ ogoun ogoun - 3.4.0.4 - KVDB, extend search method + 3.4.0.5 + KVDB https://github.com/ogoun/Zero/wiki Copyright Ogoun 2023 https://github.com/ogoun/Zero git - 3.4.0.4 - 3.4.0.4 + 3.4.0.5 + 3.4.0.5 AnyCPU;x64;x86 zero.png full