Class FixedRunnablePool<T>
Pool have fixed size.
Create new objects if pool is empty.
Skip objects if the pool is full. Object should be collected by GC in this case.
Inheritance
System.Object
FixedRunnablePool<T>
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: FixAntenna.Common.Threading.Runnable
Assembly: FixAntenna.Common.dll
Syntax
public sealed class FixedRunnablePool<T> : IRunnablePool<T> where T : IRunnableObject
Type Parameters
Name | Description |
---|---|
T |
Constructors
FixedRunnablePool(Int32, Int32, IRunnableFactory<T>)
Declaration
public FixedRunnablePool(int minSize, int maxSize, IRunnableFactory<T> objectFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | minSize | |
System.Int32 | maxSize | |
IRunnableFactory<T> | objectFactory |
Methods
Get()
Get object from pool. Create new object if pool is empty. @return
Declaration
public T Get()
Returns
Type | Description |
---|---|
T |
Release(T)
Try return object to the pool. Skip object if the pool is full.
Declaration
public void Release(T ob)
Parameters
Type | Name | Description |
---|---|---|
T | ob |