[#3] Move to netstandard 2.0

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
p.gross 2024-05-29 12:43:00 +03:00
parent ae3fc419a4
commit 0c4723c705
55 changed files with 2508 additions and 1818 deletions

View file

@ -0,0 +1,35 @@
using System;
using System.Threading.Tasks;
using Grpc.Core;
using FrostFS.Object;
namespace FrostFS.SDK.ClientV2;
internal class ObjectStreamer(AsyncClientStreamingCall<PutRequest, PutResponse> call) : IDisposable
{
public AsyncClientStreamingCall<PutRequest, PutResponse> Call { get; private set; } = call;
public async Task Write(PutRequest request)
{
if (request is null)
{
throw new ArgumentNullException(nameof(request));
}
await Call.RequestStream.WriteAsync(request);
}
public async Task<PutResponse> Close()
{
await Call.RequestStream.CompleteAsync();
return await Call.ResponseAsync;
}
public void Dispose()
{
Call.Dispose();
}
}