@@ -5,29 +5,29 @@ namespace HandyIpc.Core
55{
66 public sealed class AsyncPool < TValue > : PoolBase < TValue > where TValue : IDisposable
77 {
8- private readonly Func < Task < TValue > > _factory ;
9- private readonly Func < TValue , Task < bool > > _checkValue ;
8+ private readonly Func < Task < T > > _factory ;
9+ private readonly Func < T , Task < bool > > _checkValue ;
1010
1111 public AsyncPool ( Func < Task < TValue > > factory , Func < TValue , Task < bool > > checkValue )
1212 {
1313 _factory = factory ;
1414 _checkValue = checkValue ;
1515 }
1616
17- public async Task < RentedValue < TValue > > RentAsync ( )
17+ public async Task < RentedValue < T > > RentAsync ( )
1818 {
19- CheckDisposed ( " AsyncPool" ) ;
19+ CheckDisposed ( nameof ( AsyncPool < T > ) ) ;
2020
21- TValue value = await TakeOrCreateValue ( ) ;
22- return new RentedValue < TValue > ( value , ReturnValue ) ;
21+ T value = await TakeOrCreateValue ( ) ;
22+ return new RentedValue < T > ( value , ReturnValue ) ;
2323
2424 // Local method
25- void ReturnValue ( TValue rentedValue ) => Cache . Add ( rentedValue ) ;
25+ void ReturnValue ( T rentedValue ) => Cache . Add ( rentedValue ) ;
2626 }
2727
28- private async Task < TValue > TakeOrCreateValue ( )
28+ private async Task < T > TakeOrCreateValue ( )
2929 {
30- TValue result ;
30+ T result ;
3131 while ( ! Cache . TryTake ( out result ) || ! await _checkValue ( result ) )
3232 {
3333 Cache . Add ( await _factory ( ) ) ;
0 commit comments