32 lines
864 B
C#
32 lines
864 B
C#
using StackExchange.Redis;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace EgwCoreLib.Lux.Data.Services
|
|
{
|
|
/// <summary>
|
|
/// Interfaccia servizio REDIS x pub/sub e caching
|
|
/// </summary>
|
|
public interface IRedisService
|
|
{
|
|
#if false
|
|
IDatabase GetDatabase();
|
|
void Publish(string channel, string message);
|
|
#endif
|
|
|
|
long Publish(string channel, string message);
|
|
Task<long> PublishAsync(string channel, string message);
|
|
void Subscribe(string channel, Action<RedisChannel, RedisValue> handler);
|
|
|
|
Task<bool> SetAsync(string key, string value, TimeSpan? expiry = null);
|
|
Task<string?> GetAsync(string key);
|
|
|
|
bool Set(string key, string value, TimeSpan? expiry = null);
|
|
string? Get(string key);
|
|
}
|
|
|
|
}
|