[#24] Client: Implement pool part2
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
c9a75ea025
commit
ee20798379
63 changed files with 801 additions and 526 deletions
|
@ -17,13 +17,13 @@ public sealed class ObjectReader(AsyncServerStreamingCall<GetResponse> call) : I
|
|||
internal async Task<Object.Object> ReadHeader()
|
||||
{
|
||||
if (!await Call.ResponseStream.MoveNext().ConfigureAwait(false))
|
||||
throw new InvalidOperationException("unexpected end of stream");
|
||||
throw new FrostFsStreamException("unexpected end of stream");
|
||||
|
||||
var response = Call.ResponseStream.Current;
|
||||
Verifier.CheckResponse(response);
|
||||
|
||||
if (response.Body.ObjectPartCase != GetResponse.Types.Body.ObjectPartOneofCase.Init)
|
||||
throw new InvalidOperationException("unexpected message type");
|
||||
throw new FrostFsStreamException("unexpected message type");
|
||||
|
||||
return new Object.Object
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ public sealed class ObjectReader(AsyncServerStreamingCall<GetResponse> call) : I
|
|||
Verifier.CheckResponse(response);
|
||||
|
||||
if (response.Body.ObjectPartCase != GetResponse.Types.Body.ObjectPartOneofCase.Chunk)
|
||||
throw new InvalidOperationException("unexpected message type");
|
||||
throw new FrostFsStreamException("unexpected message type");
|
||||
|
||||
return response.Body.Chunk.Memory;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue