Creado apartir del commit b888de6c92056de294456f581a56e25e734d4ab7 de develop
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using adas_core.Domain.Models.GroupedObservations;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces
|
||||
{
|
||||
public interface ICacheService
|
||||
{
|
||||
//Métodos básicos
|
||||
void SetValue(string key, string value);
|
||||
string? GetValue(string key);
|
||||
Task<T?> GetObjectAsync<T>(string key, bool updateExpiration = true);
|
||||
Task SetObjectAsync<T>(string key, T obj, bool updateExpiration = true);
|
||||
Task<T?> GetObjectAsync<T>(string key, TimeSpan? ttlOverride, bool updateExpiration);
|
||||
Task SetObjectAsync<T>(string key, T obj, TimeSpan? ttlOverride, bool updateExpiration);
|
||||
Task DeleteObjectAsync(string key);
|
||||
Task<long> DeleteByPatternAsync(string pattern);
|
||||
void CleanCache();
|
||||
|
||||
|
||||
// Métodos para transparencia y gestión de locks
|
||||
|
||||
// GetOrSet (string key)
|
||||
Task<string?> GetOrSetValueAsync(string key, Func<Task<string>> loader, TimeSpan? ttlOverride = null);
|
||||
Task<T> GetOrSetObjectAsync<T>(
|
||||
string key,
|
||||
Func<Task<T>> factory,
|
||||
TimeSpan? ttl = null,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
// GetOrSet especializado para GroupedObservations
|
||||
Task<T> GetOrSetObjectAsync<T>(
|
||||
GroupedField groupedField,
|
||||
ObjectId patientId,
|
||||
Func<Task<T>> factory,
|
||||
TimeSpan? ttl = null,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user