[#24] Client: Implement pool part1
first iteration - base classes and methods Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
d1271df207
commit
c9a75ea025
72 changed files with 2786 additions and 468 deletions
|
@ -1,49 +0,0 @@
|
|||
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.ClientV2;
|
||||
|
||||
public class Context()
|
||||
{
|
||||
private ReadOnlyCollection<Interceptor>? interceptors;
|
||||
|
||||
private ByteString? publicKeyCache;
|
||||
|
||||
public ECDsa? Key { get; set; }
|
||||
|
||||
public FrostFsOwner? OwnerId { get; set; }
|
||||
|
||||
public FrostFsVersion? Version { get; set; }
|
||||
|
||||
public CancellationToken CancellationToken { get; set; }
|
||||
|
||||
public TimeSpan Timeout { get; set; }
|
||||
|
||||
public DateTime? Deadline => Timeout.Ticks > 0 ? DateTime.UtcNow.Add(Timeout) : null;
|
||||
|
||||
public Action<CallStatistics>? Callback { get; set; }
|
||||
|
||||
public ReadOnlyCollection<Interceptor>? Interceptors
|
||||
{
|
||||
get { return this.interceptors; }
|
||||
set { this.interceptors = value; }
|
||||
}
|
||||
|
||||
public ByteString? GetPublicKeyCache()
|
||||
{
|
||||
if (publicKeyCache == null && Key != null)
|
||||
{
|
||||
publicKeyCache = ByteString.CopyFrom(Key.PublicKey());
|
||||
}
|
||||
|
||||
return publicKeyCache;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue