ObjectPool<T> 类

定义

使用堆栈存储可用对象的简单对象池。

public class ObjectPool<T> : Orleans.Providers.Streams.Common.IObjectPool<T> where T : PooledResource<T>
type ObjectPool<'T (requires 'T :> PooledResource<'T>)> = class
    interface IObjectPool<'T (requires 'T :> PooledResource<'T>)>
Public Class ObjectPool(Of T)
Implements IObjectPool(Of T)

类型参数

T
继承
ObjectPool<T>
实现

构造函数

ObjectPool<T>(Func<T>, IObjectPoolMonitor, Nullable<TimeSpan>)

简单对象池

方法

Allocate()

分配共用资源

Free(T)

将资源返回到池

适用于