Files
serein-flow/Library/Entity/NodeDebugSetting.cs

60 lines
1.6 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Text;
2024-09-22 17:37:32 +08:00
using System.Threading.Tasks;
using static Serein.Library.Utils.ChannelFlowInterrupt;
namespace Serein.Library.Entity
{
2024-10-11 19:31:34 +08:00
/// <summary>
/// 节点调试设置,用于中断节点的运行
/// </summary>
public class NodeDebugSetting
{
/// <summary>
/// 是否使能(调试中断功能)
/// </summary>
public bool IsEnable { get; set; } = true;
/// <summary>
/// 中断级别,暂时停止继续执行后继分支。
/// </summary>
public InterruptClass InterruptClass { get; set; } = InterruptClass.None;
2024-09-22 17:37:32 +08:00
/// <summary>
/// 取消中断的回调函数
/// </summary>
public Action CancelInterruptCallback { get; set; }
2024-09-22 17:37:32 +08:00
/// <summary>
2024-10-11 19:31:34 +08:00
/// 中断Task用来取消中断
2024-09-22 17:37:32 +08:00
/// </summary>
public Func<Task<CancelType>> GetInterruptTask { get; set; }
}
2024-10-11 19:31:34 +08:00
/// <summary>
/// 中断级别,暂时停止继续执行后继分支。
/// </summary>
public enum InterruptClass
{
/// <summary>
/// 不中断
/// </summary>
None,
/// <summary>
/// 分支中断,中断进入当前节点的分支。
/// </summary>
Branch,
/// <summary>
/// 分组中断,中断进入指定节点分组的分支。(暂未实现相关)
/// </summary>
2024-09-22 17:37:32 +08:00
// Group,
/// <summary>
/// 全局中断,中断全局所有节点的运行。(暂未实现相关)
/// </summary>
Global,
}
}