mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-15 05:56:34 +08:00
1.优化了平移缩放逻辑
2.优化了触发器的执行,优化了节点执行时的代码逻辑 3.优化了节点方法委托的参数获取
This commit is contained in:
@@ -16,18 +16,9 @@ namespace Serein.Library.Entity
|
||||
/// </summary>
|
||||
public int Index { get; set; }
|
||||
/// <summary>
|
||||
/// 是否为显式参数
|
||||
/// 是否为显式参数(固定值/表达式)
|
||||
/// </summary>
|
||||
public bool IsExplicitData { get; set; }
|
||||
/// <summary>
|
||||
/// 显式类型
|
||||
/// </summary>
|
||||
public Type ExplicitType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示类型编号>
|
||||
/// </summary>
|
||||
public string ExplicitTypeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 方法需要的类型
|
||||
@@ -45,21 +36,14 @@ namespace Serein.Library.Entity
|
||||
|
||||
public string DataValue { get; set; }
|
||||
|
||||
|
||||
|
||||
public string[] Items { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public ExplicitData Clone() => new ExplicitData()
|
||||
{
|
||||
Index = Index,
|
||||
IsExplicitData = IsExplicitData,
|
||||
ExplicitType = ExplicitType,
|
||||
DataType = DataType,
|
||||
ParameterName = ParameterName,
|
||||
ExplicitTypeName = ExplicitTypeName,
|
||||
DataValue = string.IsNullOrEmpty(DataValue) ? string.Empty : DataValue,
|
||||
Items = Items.Select(it => it).ToArray(),
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.CodeDom;
|
||||
|
||||
namespace Serein.Library.Ex
|
||||
{
|
||||
@@ -7,6 +8,7 @@ namespace Serein.Library.Ex
|
||||
/// </summary>
|
||||
public class FlipflopException: Exception
|
||||
{
|
||||
|
||||
public bool IsCancel { get; }
|
||||
public FlipflopException(string message, bool isCancel = true) :base(message)
|
||||
{
|
||||
|
||||
@@ -40,8 +40,23 @@ namespace Serein.Library.Web
|
||||
}
|
||||
|
||||
listener.Prefixes.Add(prefixe); // 添加监听前缀
|
||||
|
||||
listener.Start(); // 开始监听
|
||||
try
|
||||
{
|
||||
listener.Start(); // 开始监听
|
||||
Task.Run(async () =>
|
||||
{
|
||||
while (listener.IsListening)
|
||||
{
|
||||
var context = await listener.GetContextAsync(); // 获取请求上下文
|
||||
ProcessRequestAsync(context); // 处理请求
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
listener = null;
|
||||
Console.WriteLine(ex);
|
||||
}
|
||||
|
||||
//_ = Task.Run(async () =>
|
||||
//{
|
||||
@@ -58,14 +73,7 @@ namespace Serein.Library.Web
|
||||
// }
|
||||
//});
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
while (listener.IsListening)
|
||||
{
|
||||
var context = await listener.GetContextAsync(); // 获取请求上下文
|
||||
ProcessRequestAsync(context); // 处理请求
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -115,8 +123,8 @@ namespace Serein.Library.Web
|
||||
// 停止服务器
|
||||
public void Stop()
|
||||
{
|
||||
listener.Stop(); // 停止监听
|
||||
listener.Close(); // 关闭监听器
|
||||
listener?.Stop(); // 停止监听
|
||||
listener?.Close(); // 关闭监听器
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user