|
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
3 | | -using System.Threading.Tasks; |
4 | 3 |
|
5 | 4 | namespace Open.Disposable |
6 | 5 | { |
@@ -46,21 +45,7 @@ public interface IObjectPool<T> : IDisposable |
46 | 45 | /// <returns>An item removed from the pool or generated. Should never be null.</returns> |
47 | 46 | T Take(); |
48 | 47 |
|
49 | | - |
50 | | - |
51 | | - /// <summary> |
52 | | - /// Asynchronously receives an item and adds it to the pool. Ignores null references. |
53 | | - /// WARNING: The item is considered 'dead' but resurrectable so be sure not to hold on to the item's reference. |
54 | | - /// </summary> |
55 | | - /// <param name="item">The item to give up to the pool.</param> |
56 | | - /// <param name="recycler">An optional action exectue on the item only if it's possible to return to the pool.</param> |
57 | | - Task GiveAsync(T item); |
58 | | - |
59 | | - /// <summary> |
60 | | - /// Awaits an available item from the pool. If none are available it generates one. |
61 | | - /// </summary> |
62 | | - /// <returns>An item removed from the pool or generated.</returns> |
63 | | - Task<T> TakeAsync(); |
| 48 | + |
64 | 49 | } |
65 | 50 |
|
66 | 51 | public static partial class ObjectPoolExtensions |
@@ -92,31 +77,6 @@ public static void Give<T>(this IObjectPool<T> target, T item1, T item2, params |
92 | 77 | target.Give(item2); |
93 | 78 | target.Give(items); |
94 | 79 | } |
95 | | - |
96 | | - |
97 | | - |
98 | | - /// <summary> |
99 | | - /// Asynchronously receives items and iteratively adds them to the pool. |
100 | | - /// WARNING: These items are considered 'dead' but resurrectable so be sure not to hold on to their reference. |
101 | | - /// </summary> |
102 | | - /// <param name="items">The items to give up to the pool.</param> |
103 | | - public static Task GiveAsync<T>(this IObjectPool<T> target, IEnumerable<T> items) |
104 | | - where T : class |
105 | | - { |
106 | | - return Task.Run(() => target.Give(items)); |
107 | | - } |
108 | | - |
109 | | - /// <summary> |
110 | | - /// Asynchronously receives items and iteratively adds them to the pool. |
111 | | - /// WARNING: These items are considered 'dead' but resurrectable so be sure not to hold on to their reference. |
112 | | - /// </summary> |
113 | | - /// <param name="item2">The first item to give up to the pool.</param> |
114 | | - /// <param name="item2">The second item to give up to the pool.</param> |
115 | | - /// <param name="items">The remaining items to give up to the pool.</param> |
116 | | - public static Task GiveAsync<T>(this IObjectPool<T> target, T item1, T item2, params T[] items) |
117 | | - where T : class |
118 | | - { |
119 | | - return Task.Run(() => target.Give(item1, item2, items)); |
120 | | - } |
| 80 | + |
121 | 81 | } |
122 | 82 | } |
0 commit comments