frostfs-sdk-csharp/src/FrostFS.SDK.ModelsV2/Client/Context.cs
Pavel Gross 35fe791406 [#19] Client: Use specific classes for search
Signed-off-by: Pavel Gross <p.gross@yando.com>
2024-07-25 14:37:58 +03:00

24 lines
660 B
C#

using System;
using System.Collections.Generic;
using System.Threading;
using FrostFS.SDK.ModelsV2;
using Grpc.Core.Interceptors;
namespace FrostFS.SDK.ClientV2;
public class Context()
{
private List<Interceptor>? interceptors;
public CancellationToken CancellationToken { get; set; } = default;
public TimeSpan Timeout { get; set; } = default;
public DateTime? Deadline => Timeout.Ticks > 0 ? DateTime.UtcNow.Add(Timeout) : null;
public Action<CallStatistics>? Callback { get; set; }
public List<Interceptor> Interceptors
{
get { return this.interceptors ??= []; }
set { this.interceptors = value; }
}
}