File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed
Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 33
44namespace HandyIpc . Core
55{
6- internal sealed class AsyncPool < T > : PoolBase < T > where T : IDisposable
6+ public sealed class AsyncPool < T > : PoolBase < T > where T : IDisposable
77 {
88 private readonly Func < Task < T > > _factory ;
99 private readonly Func < T , Task < bool > > _checkValue ;
1010
11- public AsyncPool ( Func < Task < T > > factory , Func < T , Task < bool > > ? checkValue = null )
11+ public AsyncPool ( Func < Task < T > > factory , Func < T , Task < bool > > checkValue )
1212 {
1313 _factory = factory ;
1414 _checkValue = checkValue ;
Original file line number Diff line number Diff line change 22
33namespace HandyIpc . Core
44{
5- internal sealed class Pool < T > : PoolBase < T > where T : IDisposable
5+ public sealed class Pool < T > : PoolBase < T > where T : IDisposable
66 {
77 private readonly Func < T > _factory ;
88 private readonly Func < T , bool > _checkValue ;
99
10- public Pool ( Func < T > factory , Func < T , bool > ? checkValue = null )
10+ public Pool ( Func < T > factory , Func < T , bool > checkValue )
1111 {
1212 _factory = factory ;
1313 _checkValue = checkValue ;
Original file line number Diff line number Diff line change 33
44namespace HandyIpc . Core
55{
6- public abstract class PoolBase < TValue > : IDisposable where TValue : IDisposable
6+ public abstract class PoolBase < T > : IDisposable where T : IDisposable
77 {
8- protected readonly ConcurrentBag < TValue > Cache = new ( ) ;
8+ protected readonly ConcurrentBag < T > Cache = new ( ) ;
99
1010 private bool _isDisposed ;
1111
@@ -23,7 +23,7 @@ protected virtual void Dispose(bool disposing)
2323
2424 if ( disposing )
2525 {
26- while ( Cache . TryTake ( out TValue item ) )
26+ while ( Cache . TryTake ( out T item ) )
2727 {
2828 item . Dispose ( ) ;
2929 }
Original file line number Diff line number Diff line change 22
33namespace HandyIpc . Core
44{
5- public readonly struct RentedValue < TValue > : IDisposable
5+ public readonly struct RentedValue < T > : IDisposable
66 {
7- private readonly Action < TValue > _dispose ;
7+ private readonly Action < T > _dispose ;
88
9- public TValue Value { get ; }
9+ public T Value { get ; }
1010
11- public RentedValue ( TValue value , Action < TValue > dispose )
11+ public RentedValue ( T value , Action < T > dispose )
1212 {
1313 _dispose = dispose ;
1414 Value = value ;
You can’t perform that action at this time.
0 commit comments