26 lines
710 B
C#
26 lines
710 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 string SessionToken { get; set; } = string.Empty;
|
|
|
|
public DateTime? Deadline => Timeout.Ticks > 0 ? DateTime.UtcNow.Add(Timeout) : null;
|
|
|
|
public Action<CallStatistics> Callback { get; set; }
|
|
|
|
public List<Interceptor> Interceptors
|
|
{
|
|
get { return interceptors ??= []; }
|
|
set { interceptors = value; }
|
|
}
|
|
}
|