ObjectPool manages objects whose instantiation and initialization costs
prohibit constant allocation/deallocation. ObjectPool recycles old
objects and dynamically increases and decreases the number of
allocated objects as demand requires.
Inheritance Hierarchy
IMailAPI_NETObjectPoolT
Namespace: IMailAPI_NET
Assembly: IMailAPI_NET (in IMailAPI_NET.dll) Version: 1.0.0.0
Syntax
Type Parameters
- T
- Any type with the new() constraint.
The ObjectPoolT type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | ObjectPoolT |
ObjectPool constructor.
|
Methods
Name | Description | |
---|---|---|
![]() | Acquire |
Get a new pool item. The pool will keep a count of this item, so it needs to be
given back to the pool with Release().
|
![]() | Equals | (Inherited from Object.) |
![]() | Forget |
In the event that items pulled from the queue are no longer useable, and
should not be repooled, Forget forces ItemsAllocated to stop keeping
track of those items, allowing more items to be created, if necessary.
You must call this if you choose not to Release an item back to the pool.
|
![]() | GetEnumerator | |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | Release |
Releases the specified pool item, putting it back into the pool
of available items for recycling.
|
![]() | Shutdown |
Prepares the pool for shutdown, and calls Release on each pool item.
Does not account for extant items in use.
|
![]() | ToString | (Inherited from Object.) |
Fields
Name | Description | |
---|---|---|
![]() | ShuttingDown |
Properties
Name | Description | |
---|---|---|
![]() | Count | |
![]() | ItemLifeSpanMinutes | |
![]() | ItemsAllocated | |
![]() | MaxItems | |
![]() | MinItems |
See Also