You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.2 KiB

using Newtonsoft.Json.Linq;
namespace CoreAgent.ProtocolClient.Models
{
/// <summary>
/// 消息处理器模型
/// 用于处理WebSocket消息的回调和错误处理
/// 支持不同类型的消息处理器,包括普通消息、错误消息和日志获取消息
/// </summary>
public class MessageHandler
{
/// <summary>
/// 消息处理回调函数
/// 当接收到消息时会被调用的委托函数
/// </summary>
public Action<JObject>? Callback { get; set; }
/// <summary>
/// 标识是否为错误处理器
/// 当为true时,该处理器专门用于处理错误消息
/// </summary>
public bool ErrorHandler { get; set; }
/// <summary>
/// 处理器创建时间
/// 用于跟踪处理器的生命周期和超时管理
/// </summary>
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
/// <summary>
/// 标识是否为日志获取处理器
/// 当为true时,该处理器专门用于处理日志获取相关的消息
/// </summary>
public bool IsLogGetHandler { get; set; }
}
}