Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

Commit

Permalink
timed object pool
Browse files Browse the repository at this point in the history
  • Loading branch information
pomma89 committed Apr 2, 2017
1 parent 80a8128 commit 116aee5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
42 changes: 42 additions & 0 deletions src/CodeProject.ObjectPool/ITimedObjectPool.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// File name: ITimedObjectPool.cs
//
// Author(s): Alessio Parma <alessio.parma@gmail.com>
//
// The MIT License (MIT)
//
// Copyright (c) 2013-2018 Alessio Parma <alessio.parma@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
// associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

namespace CodeProject.ObjectPool
{
/// <summary>
/// A pool where objects are automatically removed after a period of inactivity.
/// </summary>
/// <typeparam name="T">
/// The type of the object that which will be managed by the pool. The pooled object have to be
/// a sub-class of PooledObject.
/// </typeparam>
#if NET35
public interface ITimedObjectPool<T> : IObjectPool<T>
#else

public interface ITimedObjectPool<out T> : IObjectPool<T>
#endif
where T : PooledObject
{
}
}
4 changes: 2 additions & 2 deletions src/CodeProject.ObjectPool/TimedObjectPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

using System.Threading;

namespace CodeProject.ObjectPool.Examples.Customizations
namespace CodeProject.ObjectPool
{
/// <summary>
/// A pool where objects are automatically removed after a period of inactivity.
Expand All @@ -34,7 +34,7 @@ namespace CodeProject.ObjectPool.Examples.Customizations
/// The type of the object that which will be managed by the pool. The pooled object have to be
/// a sub-class of PooledObject.
/// </typeparam>
internal class TimedObjectPool<T> : ObjectPool<T>
internal class TimedObjectPool<T> : ObjectPool<T>, ITimedObjectPool<T>
where T : PooledObject
{
private readonly Timer Timer;
Expand Down

0 comments on commit 116aee5

Please sign in to comment.