29 lines
806 B
C#
29 lines
806 B
C#
using LiveForum.Model.Events;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace LiveForum.IService.Messages
|
|
{
|
|
/// <summary>
|
|
/// 消息事件总线接口
|
|
/// 负责发布消息相关事件到队列
|
|
/// </summary>
|
|
public interface IMessageEventBus
|
|
{
|
|
/// <summary>
|
|
/// 发布消息事件
|
|
/// </summary>
|
|
/// <typeparam name="T">事件类型</typeparam>
|
|
/// <param name="eventData">事件数据</param>
|
|
/// <returns></returns>
|
|
Task PublishAsync<T>(T eventData) where T : MessageEventBase;
|
|
|
|
/// <summary>
|
|
/// 获取队列长度(用于监控)
|
|
/// </summary>
|
|
/// <param name="queueName">队列名称</param>
|
|
/// <returns></returns>
|
|
Task<long> GetQueueLengthAsync(string queueName);
|
|
}
|
|
}
|
|
|