IPooledComponent Interface |
Namespace: Autofac.Pooling
The IPooledComponent type exposes the following members.
Name | Description | |
---|---|---|
OnGetFromPool |
Invoked when this instance is retrieved from the pool. Any dependencies retrieved using the provided IComponentContext
MUST be discarded in OnReturnToPool, otherwise memory leaks may occur.
| |
OnReturnToPool | Invoked when this instance is being returned to the pool. Any dependencies retrieved in OnGetFromPool(IComponentContext, IEnumerableParameter) should be discarded in this method. If the maximum pool capacity has been reached (or a custom IPooledRegistrationPolicyTPooledObject decides not to return the instance to the pool), this method will be invoked, but then the object will not be put back in the pool (and may be disposed if the component implements IDisposable). |