wanshenmean
2026-03-11 a8f45091019012eeafec563913dee71cda3d9790
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
namespace WIDESEAWCS_RedisService.PubSub
{
    public interface IMessageQueueService
    {
        /// <summary>
        /// 发布消息
        /// </summary>
        long Publish(string channel, string message);
 
        /// <summary>
        /// 订阅频道
        /// </summary>
        void Subscribe(string channel, Action<string, string> handler);
 
        /// <summary>
        /// 取消订阅
        /// </summary>
        void Unsubscribe(string channel);
 
        /// <summary>
        /// 推送消息到可靠队列(List)
        /// </summary>
        long Enqueue(string queueName, string message);
 
        /// <summary>
        /// 从可靠队列弹出消息
        /// </summary>
        string? Dequeue(string queueName, TimeSpan? timeout = null);
 
        /// <summary>
        /// 获取队列长度
        /// </summary>
        long GetQueueLength(string queueName);
    }
}