[#28] Client: Apply code optimizations
All checks were successful
DCO / DCO (pull_request) Successful in 33s
lint-build / dotnet8.0 (pull_request) Successful in 1m4s
lint-build / dotnet8.0 (push) Successful in 49s

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2024-11-18 16:57:20 +03:00
parent 766f61a5f7
commit 749000a090
57 changed files with 845 additions and 1116 deletions

View file

@ -1,27 +1,16 @@
using System;
using System.Collections.ObjectModel;
using System.Security.Cryptography;
using System.Threading;
using FrostFS.SDK.Cryptography;
using Google.Protobuf;
using Grpc.Core.Interceptors;
namespace FrostFS.SDK.Client;
public class CallContext()
{
private ByteString? publicKeyCache;
internal Action<Exception>? PoolErrorHandler { get; set; }
// internal Action<Exception>? PoolErrorHandler { get; set; }
public ECDsa? Key { get; set; }
// public FrostFsOwner? OwnerId { get; set; }
public FrostFsOwner? OwnerId { get; set; }
public FrostFsVersion? Version { get; set; }
// public FrostFsVersion? Version { get; set; }
public CancellationToken CancellationToken { get; set; }
@ -29,17 +18,7 @@ public class CallContext()
public DateTime? Deadline => Timeout.Ticks > 0 ? DateTime.UtcNow.Add(Timeout) : null;
public Action<CallStatistics>? Callback { get; set; }
// public Action<CallStatistics>? Callback { get; set; }
public Collection<Interceptor> Interceptors { get; } = [];
public ByteString? GetPublicKeyCache()
{
if (publicKeyCache == null && Key != null)
{
publicKeyCache = ByteString.CopyFrom(Key.PublicKey());
}
return publicKeyCache;
}
// public Collection<Interceptor> Interceptors { get; } = [];
}