Interface ConcurrentObjectPool<T>.IRental
Represents rented object.
Namespace: DotNext.Threading
Assembly: DotNext.Threading.dll
Syntax
public interface IRental : IDisposable
Remarks
Call using
statement
as follows:
var pool = new ConcurrentObjectPool<DatabaseConnection>();
using(var rent = pool.Rent())
{
rent.Resource.ExecuteQuery();
}
If you gets the resource from the rental object outside of using
block
then behavior of object pool becomes unpredictable.
Properties
| Improve this Doc View SourceResource
Gets or sets rented object.
Declaration
T Resource { get; set; }
Property Value
Type | Description |
---|---|
T |