Skip to content

ObjectPool<T> Constructors

Simple object pool that uses a stack to store available objects.

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

View source
public ObjectPool(Func<T> factoryFunc, IObjectPoolMonitor monitor = null, TimeSpan? monitorWriteInterval = null)
Simple object pool

Parameters

factoryFuncFunc<T>
Function used to create new resources of type T
monitorIObjectPoolMonitor
monitor to report statistics for object pool
monitorWriteIntervalTimeSpan?