Interface IObjectPool<T>
Minimal Pool interface. If you wanna to have more advanced pool management you can use PoolService<T>.
Assembly: Eco.Shared.dll
Syntax
public interface IObjectPool<T>
where T : class
Type Parameters
Properties
Count
Current number of elements in pool.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
Methods
Get()
Returns object from pool (if any) or null
if pool is empty. It doesn't create new instance.
Declaration
Returns
TryAdd(T)
Tries to add obj
to pool. If succeed then it returns true
, otherwise (if pool is full or object is incompatible with pool) it will return false
. You can handle return value for final object cleanup.
Declaration
Parameters
Type |
Name |
Description |
T |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Extension Methods