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 3
3
4
4
namespace HandyIpc . Core
5
5
{
6
- internal sealed class AsyncPool < T > : PoolBase < T > where T : IDisposable
6
+ public sealed class AsyncPool < T > : PoolBase < T > where T : IDisposable
7
7
{
8
8
private readonly Func < Task < T > > _factory ;
9
9
private readonly Func < T , Task < bool > > _checkValue ;
10
10
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 )
12
12
{
13
13
_factory = factory ;
14
14
_checkValue = checkValue ;
Original file line number Diff line number Diff line change 2
2
3
3
namespace HandyIpc . Core
4
4
{
5
- internal sealed class Pool < T > : PoolBase < T > where T : IDisposable
5
+ public sealed class Pool < T > : PoolBase < T > where T : IDisposable
6
6
{
7
7
private readonly Func < T > _factory ;
8
8
private readonly Func < T , bool > _checkValue ;
9
9
10
- public Pool ( Func < T > factory , Func < T , bool > ? checkValue = null )
10
+ public Pool ( Func < T > factory , Func < T , bool > checkValue )
11
11
{
12
12
_factory = factory ;
13
13
_checkValue = checkValue ;
Original file line number Diff line number Diff line change 3
3
4
4
namespace HandyIpc . Core
5
5
{
6
- public abstract class PoolBase < TValue > : IDisposable where TValue : IDisposable
6
+ public abstract class PoolBase < T > : IDisposable where T : IDisposable
7
7
{
8
- protected readonly ConcurrentBag < TValue > Cache = new ( ) ;
8
+ protected readonly ConcurrentBag < T > Cache = new ( ) ;
9
9
10
10
private bool _isDisposed ;
11
11
@@ -23,7 +23,7 @@ protected virtual void Dispose(bool disposing)
23
23
24
24
if ( disposing )
25
25
{
26
- while ( Cache . TryTake ( out TValue item ) )
26
+ while ( Cache . TryTake ( out T item ) )
27
27
{
28
28
item . Dispose ( ) ;
29
29
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace HandyIpc . Core
4
4
{
5
- public readonly struct RentedValue < TValue > : IDisposable
5
+ public readonly struct RentedValue < T > : IDisposable
6
6
{
7
- private readonly Action < TValue > _dispose ;
7
+ private readonly Action < T > _dispose ;
8
8
9
- public TValue Value { get ; }
9
+ public T Value { get ; }
10
10
11
- public RentedValue ( TValue value , Action < TValue > dispose )
11
+ public RentedValue ( T value , Action < T > dispose )
12
12
{
13
13
_dispose = dispose ;
14
14
Value = value ;
You can’t perform that action at this time.
0 commit comments