1. 修改了Serein.Library中的ObjectPool工具类,提供了对象归还的默认处理方法(通过构造方法指定Action<T>委托)

2. 不再显式调用流程上下文的Reset()方法,而改为通过对象池调用
3. 同样的,对于同样使用了ObjectPool管理上下文的Serein.Proto.WebSocket项目而言,也进行了同2.一样的修改
This commit is contained in:
fengjiayi
2025-08-23 16:19:30 +08:00
parent 5656619a3b
commit 819320f355
8 changed files with 47 additions and 49 deletions

View File

@@ -41,6 +41,9 @@ namespace Serein.Library
FlowContextPool = new Utils.ObjectPool<IFlowContext>(() =>
{
return new FlowContext(flowEnvironment);
}, context =>
{
context.Reset();
});
}