Click or drag to resize

ReusableObjectPool<T> .TakeObject Method

Gets an object from the pool, or creates a new one if no pool items are available.

Namespace: GSF
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.244-beta+cf93f5f8aea4b941e9b426fe4e180c2bd85d31a2
Syntax
public T TakeObject()
View Source

Return Value

T
An available object from the pool, or a new one if no pool items are available.
Remarks
If type of T implements ISupportLifecycle, the pool will attach to the item's Disposed event such that the object can be automatically restored to the pool upon Dispose(). It will be up to class implementors to make sure Initialize() makes the class ready for use as this method will always be called for an object being taken from the pool.
See Also