frostfs-sdk-csharp/src/FrostFS.SDK.ClientV2/Pool/SessionCache.cs
Pavel Gross 003b7fdfdd
All checks were successful
DCO / DCO (pull_request) Successful in 47s
[#25] Client: Implement Patch and Range methods
Signed-off-by: Pavel Gross <p.gross@yadro.com>
2024-11-08 10:38:50 +03:00

24 lines
571 B
C#

using System;
using System.Collections;
namespace FrostFS.SDK.ClientV2;
internal struct SessionCache(ulong sessionExpirationDuration)
{
internal Hashtable Cache { get; } = [];
internal ulong CurrentEpoch { get; set; }
internal ulong TokenDuration { get; set; } = sessionExpirationDuration;
internal void DeleteByPrefix(string prefix)
{
foreach (var key in Cache.Keys)
{
if (((string)key).StartsWith(prefix, StringComparison.Ordinal))
{
Cache.Remove(key);
}
}
}
}