Files
Caspian.Elsa.Core/src/modules/Elsa.Caching/Contracts/ICacheProvider.cs
T

15 lines
575 B
C#

using Elsa.Caching.Models;
namespace Elsa.Caching;
/// <summary>Storage for cache entries. Implementations must distinguish a miss from a cached null.</summary>
public interface ICacheProvider
{
bool IsShared { get; }
Task<CacheResult<T>> GetAsync<T>(string key, CancellationToken cancellationToken = default);
Task SetAsync<T>(string key, T? value, CacheEntryOptions options, CancellationToken cancellationToken = default);
Task RemoveAsync(string key, CancellationToken cancellationToken = default);
}
public record CacheResult<T>(bool Found, T? Value);