mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-13 13:09:25 +08:00
重写了节点主动中断功能,修改了运行环境持久化注册已有实例的逻辑。
This commit is contained in:
@@ -76,18 +76,18 @@ namespace Serein.Library.Utils
|
||||
/// 使用 ObjectPool 来复用 TriggerResult 对象
|
||||
/// </summary>
|
||||
// 示例 TriggerResult 对象池
|
||||
public class TriggerResultPool
|
||||
public class TriggerResultPool<TResult>
|
||||
{
|
||||
private readonly ConcurrentExpandingObjectPool<TriggerResult<object>> _objectPool;
|
||||
private readonly ConcurrentExpandingObjectPool<TriggerResult<TResult>> _objectPool;
|
||||
|
||||
public TriggerResultPool(int defaultCapacity = 30)
|
||||
{
|
||||
_objectPool = new ConcurrentExpandingObjectPool<TriggerResult<object>>(defaultCapacity);
|
||||
_objectPool = new ConcurrentExpandingObjectPool<TriggerResult<TResult>>(defaultCapacity);
|
||||
}
|
||||
|
||||
public TriggerResult<object> Get() => _objectPool.Get();
|
||||
public TriggerResult<TResult> Get() => _objectPool.Get();
|
||||
|
||||
public void Return(TriggerResult<object> result) => _objectPool.Return(result);
|
||||
public void Return(TriggerResult<TResult> result) => _objectPool.Return(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user