[#3] Move to netstandard 2.0
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
ae3fc419a4
commit
0c4723c705
55 changed files with 2508 additions and 1818 deletions
34
src/FrostFS.SDK.ClientV2/Services/SearchReader.cs
Normal file
34
src/FrostFS.SDK.ClientV2/Services/SearchReader.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Grpc.Core;
|
||||
|
||||
using FrostFS.Object;
|
||||
using FrostFS.Refs;
|
||||
|
||||
namespace FrostFS.SDK.ClientV2;
|
||||
|
||||
internal class SearchReader(AsyncServerStreamingCall<SearchResponse> call) : IDisposable
|
||||
{
|
||||
public AsyncServerStreamingCall<SearchResponse> Call { get; private set; } = call;
|
||||
|
||||
public async Task<List<ObjectID>?> Read()
|
||||
{
|
||||
if (!await Call.ResponseStream.MoveNext())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var response = Call.ResponseStream.Current;
|
||||
Verifier.CheckResponse(response);
|
||||
|
||||
return response.Body?.IdList.ToList();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Call.Dispose();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue